Posts

Showing posts from April 17, 2012
Call Asp.net Page Method Without Microsoft Ajax, without j query Have you ever thought that we can call the web method without using j query, or Microsoft Ajax, This tutorial will help you lot to understand the Ajax in asp.net Default.aspx             <button onclick="javascript:callWebMethod();">             GetName</button> This button will call the callWebMethod() javascript method Default.aspx.cs Lets call GetName method using javascript       //I will call this method from client code using java script       [WebMethod]         public static string GetName(string name)         {             return "Hello " + name;         }  Javascript Code //name is the parameter in GetName Web method //vijay is the parameter value  var data = '{"name":"vijay"}';   // I will call this method on above button click event function callWebMethod() {     var xmlhttp = createXMLHTTPObject();     xmlhttp.onreadysta