0

I need to call a c# server method through the javascript. I have a gridview in which i have a column with dropdown list. When i change the dropdown's value i need to call a server side method through javascript and change the value of another text box in the gridview.

I am able to do this on the selected index change. but i am slightly worried about the performance.

i am using asp.net c#.

Please let me know how to do this.

3
  • Why do you need to call a servers side method to change the value of a textbox? Or are those two independent actions? Commented May 3, 2010 at 18:03
  • 1
    Wrap the GridView in an UpdatePanel. It will probably be good enough...if not at least you only spent 2 minutes adding an UpdatePanel. Commented May 3, 2010 at 18:19
  • @Romanarmy: my intention is to improve the performance of my page. Suppose if the user changes textbox value or drodpwnlist, it may take sometime to hit the server because of the viewstate. I dont wanna do that.on the textbox change i need to calculate few thing on that row. @Paper1337: Even though if i put the gridview in the updatepanel,i wont get performance. Suppose i have around 100 rows in the griview. at this point of time response time will be more,. Commented May 6, 2010 at 9:13

2 Answers 2

3

Can also use PageMethods with ajax like here

http://aspalliance.com/1922_PageMethods_In_ASPNET_AJAX

Sign up to request clarification or add additional context in comments.

Comments

1

You're going to need to use AJAX in a manner similar to this: http://www.codeproject.com/KB/aspnet/Ajax_Samplecode_in_C_Net.aspx

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.