S Steve Jan 9, 2008 #1 How do I get the previous value of a text box ? Is there a way to access the TextBox control state ? Thanks for any direction, Steve
How do I get the previous value of a text box ? Is there a way to access the TextBox control state ? Thanks for any direction, Steve
M Mark Rae [MVP] Jan 9, 2008 #2 How do I get the previous value of a text box ? Is there a way to access the TextBox control state ? Click to expand... There are some clever tricks you can do with ViewState, but by far the simplest (and 100% guaranteed) method is to include a hidden field containing the initial value of the textbox and then compare the two at postback: <asp:TextBox ID="MyTextBox" runat="server" Text="Hello" /> <asp:HiddenField ID="MyHiddenTextBox" runat="server" Value="Hello" />
How do I get the previous value of a text box ? Is there a way to access the TextBox control state ? Click to expand... There are some clever tricks you can do with ViewState, but by far the simplest (and 100% guaranteed) method is to include a hidden field containing the initial value of the textbox and then compare the two at postback: <asp:TextBox ID="MyTextBox" runat="server" Text="Hello" /> <asp:HiddenField ID="MyHiddenTextBox" runat="server" Value="Hello" />
H Hal Rosser Jan 10, 2008 #3 Steve said: How do I get the previous value of a text box ? Is there a way to access the TextBox control state ? Thanks for any direction, Steve Click to expand... This video talks some about postback http://msdn2.microsoft.com/en-us/beginner/bb308809.aspx
Steve said: How do I get the previous value of a text box ? Is there a way to access the TextBox control state ? Thanks for any direction, Steve Click to expand... This video talks some about postback http://msdn2.microsoft.com/en-us/beginner/bb308809.aspx