开发者

Calling a server side function using jquery [closed]

开发者_开发百科 It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center. Closed 10 years ago.

How to call a server side function written in c# using jquery without using pagemethods ?


You can use jQuery ajax to make a server side call asynchronously. Since you want to execute a server side method. I would suggest you to expose it as a webmethod in a websservice and then you can call .asmx/webthodName using ajax.

But still if you want to do your way then you can creat an aspx page which will take certain parameter say (methodName). You can make a ajax call to this aspx page and using the methodName parameter value you can execute the required method and send only the required response after ending the response using Response.End(). Hope this makes sense to you.

jQuery ajax example

$.ajax({
  url: 'urlOfThePage',
  data: {},
  success: function( data ) {
     //Do your stuff here 
  }
});
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜