return a javascript value from C#

  • Thread starter Thread starter ms_dotnet
  • Start date Start date
M

ms_dotnet

I create HTML Text Box controls dynamically . I want to get the
textbox value from C#.

For Eg
In aspx file
<script>
function fnTest()
{
return(document.forms[0].txt0.value);
}
</script>

In C#
In Button Click

Response.Write("<script>fnTest();</script>");
 
If the textbox has a Name attribute, you can check the Request.Forms
collection for the value.

-Rob Teixeira [MVP]
 
Back
Top