javascript communication with server controls?
-
Is it possible for javascript to communicate with server side controls? Say, how can i retrieve a server control (button)'s text from javascript? Im new to javascript, and i think that javascript is for only client side's stuff. and it is not possible for javascript to raise some server side events etc.
-
Is it possible for javascript to communicate with server side controls? Say, how can i retrieve a server control (button)'s text from javascript? Im new to javascript, and i think that javascript is for only client side's stuff. and it is not possible for javascript to raise some server side events etc.
Basically, the ASP.NET control renders to the html element at the client, so you can use javascript to access the rendered html button element. To do that you can have a look at the
getElementById
method of the document[^] object and the button's members[^]. Since you are new to javascript, this tutorial[^] can get you started. -
Is it possible for javascript to communicate with server side controls? Say, how can i retrieve a server control (button)'s text from javascript? Im new to javascript, and i think that javascript is for only client side's stuff. and it is not possible for javascript to raise some server side events etc.
Your right. Controls are server side only. And the java script is client side only. Although you could update the controls and force a postback. But that bad design, and a way to change the data on server side is always possible. 1 line of code equals many bugs. So don't write any!!
-
Your right. Controls are server side only. And the java script is client side only. Although you could update the controls and force a postback. But that bad design, and a way to change the data on server side is always possible. 1 line of code equals many bugs. So don't write any!!
-
Does this object extend the list control? If it does the AutoPostBack property will do it. Otherwise, javascript has a function "__doPostback" that will force it. Check out this link: http://www.dotnetspider.com/Technology/KBPages/195.aspx[^] 1 line of code equals many bugs. So don't write any!!