HTML textbox value always returns an empty string at asp.net button click event

Zunhanxr

New Member
I have a simple stopwatch application which updates HTML textbox values using a javascript.\[code\]<form name="clock"> <input type="text" size="12" name="stwa" value="http://stackoverflow.com/questions/15873021/00 : 00 : 00" style="texalign:center"/> <input type="text" size="12" name="stwb" style="text-align:center" /><br /> <input type="button" name="theButton" onClick="stopwatch(this.value);" value="http://stackoverflow.com/questions/15873021/Start" /> <input type="button" value="http://stackoverflow.com/questions/15873021/Reset" onClick="resetIt();reset();" /> </form>\[/code\]I also have an asp.net button control which should submit value in 'stwb' at the button click. Although stwb textbox gets updated with the javascript correctly, it always returns an empty string at button click.\[code\]<form id="form1" runat="server"> <asp:Button ID="Button2" runat="server" Text="Button" onclick="Button2_Click"/></form>\[/code\]Button click event for the method.\[code\]protected void Button2_Click(object sender, EventArgs e) { String strValue = http://stackoverflow.com/questions/15873021/Page.Request.Form["stwb"].ToString(); Response.Write(strValue); }\[/code\]Appreciate any help in this regard.
 
Top