Accessing server side controls from Javascript

With ASP.Net Ajax, you can get the server side controls from Javascript using ASP.Net Ajax javascript API. With this feature will be helpful for developers, whom wish to play around Page methods in ASP.Net Ajax.

function getValueInText()
{
var myText = $get("MyText");
alert(myText.value);
//You can also set the value of the Textbox using the same method.
myText.value = "This is updated";
}

In the above code, MyText is a server side asp.net textbox.
You can get more information about all this from ASP.Net Ajax official site.

This entry was posted in .Net, .Net 3.0 / 3.5, ASP.Net, Javascript. Bookmark the permalink.

Leave a Reply

Your email address will not be published. Required fields are marked *

*


*

You may use these HTML tags and attributes: <a href="" title="" rel=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>