Wednesday, September 30, 2015

Self Hosting Code in WCF

class Program
    {
        static void Main(string[] args)
        {
       
            Type srvcinfo=typeof(Greet);
            //Create a URI to serve as the base address
            // Address as well binding
            Uri uri=new Uri("https://localhost:8086/Myservice");

 //Create ServiceHost         
            ServiceHost host=new ServiceHost(srvcinfo,uri);

 //Add a service endpoint  

            host.AddServiceEndpoint(typeof(IGreet), new WSHttpBinding(), "ws");

//Start the Service    

            host.Open();
            Console.WriteLine("Hosted the service");
            Console.Read();


        }
    }

Wednesday, September 16, 2015

Jquery begin- animations

<!DOCTYPE html>
<html>

  <head>
    <script data-require="jquery@*" data-semver="2.1.4" src="http://code.jquery.com/jquery-2.1.4.min.js"></script>
    <link rel="stylesheet" href="style.css" />
    <script src="script.js"></script>
  </head>

  <body>
    <h1>Hello Plunker!</h1>
    <button id="btnhide">Hide</button>
    <button id="btnShow">show</button>
    <button id="btnToggle">Toggle</button>
    <button id="btnFade">Fade</button><br/><br>
    <input type="text" id="txtname" name="txtname"/>
    <button id="display">Display</button>
    <div id ="displaydiv"></div>
    <script>
   
     
      $("#btnhide").click(
                          function()
                          {
                             $("h1").hide();
   
                          }
                        );
       $("#btnShow").click(
                          function()
                          {
                             $("h1").show();
   
                          }
                        );
     $("#btnToggle").click(
                          function()
                          {
                             $("h1").toggle();
   
                          }
                        );
     $("#btnFade").click(
                          function()
                          {
                             $("h1").fadeOut("slow");
   
                          }
                        );
    $("#display").click(
                          function()
                          {
                             $("#displaydiv").text($("#txtname").val());
                               
   
                          }
                        );
    </script>
  </body>

</html>