Tuesday, November 27, 2007 1:15 PM
I am a new user & learner of .NET and this is my first question.
I am entering the values into a listbox using java script logic.
java script is working fine.But because of postback those values are disappearing. Please suggest me a solution
Thursday, November 29, 2007 4:32 AMModerator
<input type="hidden" id="hd1" runat="server" />
document.getElementById("hd1").value = "Value1";
<asp:Button ID="btnTest" runat="server" Text="Test" OnClientClick="SaveValuesToHidden()" />
Then get the values from the behind code as follows:
string value1 = hd1.Value;
Hope this helps,
Wednesday, July 02, 2008 2:46 AMDon't set the ReadOnly proterty to [true] of asp:textbox.
Friday, October 17, 2008 7:51 PMHi !!
Sunday, December 19, 2010 1:51 AM
I have the similar question, Has anyone solved the problem? I'm still waiting for the answer.
Monday, April 23, 2012 7:23 AM
Place the field which is giving you trouble inside a form with "runat=server" attribute and try. Then it will reflect the values set dynamically on the client side in your code-behind.
I'm not sure of this behavior but the above seemed to work for me.
- Proposed As Answer by devinlgls Monday, April 23, 2012 7:23 AM