Click here to Skip to main content
15,902,114 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
//my code
function ShowCurrentTime() {
$.ajax({
type: "POST",
url: "../forms/WebForm1.aspx/showTime", // this line of code does not work
data: "{}",
contentType: "application/json; charset=ut f-8",
dataType: "json",
success: OnSuccess,
failure: function (response) {
alert(response.d);
}
});
alert("success");
}
Posted
Updated 26-Aug-14 9:09am
v2
Comments
MuhammadUSman1 27-Aug-14 1:30am    
showTime is taking any parameter?

Check solution.

The format you have is for web services.

For just a page you can pass what you are doing in the querystring

JavaScript
url"../forms/WebForm1.aspx?action=ShowTime


for example. And then check the querystring in the Page_Load event.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900