Calling a server side function using jquery [closed]
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
}
});
精彩评论