How i call the C# function in using JavaScript in asp.net

Posted by Er.deepakdalal under JavaScript on 5/5/2010 | Views : 11840 | Status : [Member] | Replies : 3
Hi Friends

i am working on a web application in the application i have to work on the keypress event on the textbox which i catch by JavaScript so after catching the event i have to some work which i am code in the C# so how i call that c# function in the JavaScript.




Responses

Posted by: Poster on: 5/5/2010 [Member] Starter

Up
0
Down
Look at this concept, this may help http://www.dotnetfunda.com/articles/article454-using-pagemethods-and-json-in-aspnet-ajax-.aspx .

Thank you

Er.deepakdalal, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Pavanandey on: 5/6/2010 [Member] Bronze

Up
0
Down
Hi,

u can call the server side event from javascript as below

in javascript function call this

__doPostBack('txtFilter', '');

protected void txtFilter_TextChanged(object sender, EventArgs e)
{

}

Thanks
Pavan Kumar
Mark Answer if this fits the need

Er.deepakdalal, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Abhi2434 on: 5/6/2010 [Member] [Microsoft_MVP] [MVP] Silver

Up
0
Down
Actually you need AJAX to do this.

PageMethods is the simplest way to do this.

To know about AJAX you may also read :
http://www.w3schools.com/ajax/default.asp

www.abhisheksur.com

Er.deepakdalal, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response