Pages

Reterving & assigning values of Server control using javascript

1)Create a function in javascript section of web page 2)Using document object call appropriate control id to retrive & assign value 3)Both control should be server control . 4)Call javascript function using Clientscript.RegisterStartupscript()
pseudo code Javascript function fun1() { //Assume one Dropdown & TextBox var s = document.getElementById("ddllist").Value;//or .innerText (to get all value in ddl) document.getElementById("txtUser").Value=s//or .innerText; } Server Side Code //call in any function of server side code ClientScript.RegisterScript(this.getType(),"key1","fun1",True);