Form state change

A

Anatoli Trifonov

Hi.

This is probably easy but I can't find solution so far.

I have a web form with several text boxes.
System.Web.UI.WebControls.TextBox
One submit button
System.Web.UI.WebControls.Button
When button is clicked form submitts fine.
I need to know if used changed any of the textboxes wihtout any specific
events to any of textboxes.
I know I can save the old values and then compare but is not there something
automatic in ASP.Net to track that?

Thanks.
AT
 
K

Ken Dopierala Jr.

Hi,

I'm not sure what you mean about "without any specific events to any of
textboxes". The TextBox server controls has a TextChanged event that you
can hook up to every text box. One event can cover all text boxes if you
have them all handled by the same event. Other than that you'll have to use
javascript and a hidden field.

<input type="hidden" id="hidChanged" name="hidChanged" runat="server">

Set this to 0. Then for each textbox:

TextBox1.Attributes.Add("onkeydown",
"document.GetElementById('hidChanged').value = 0;")

Then on your post back check if hidChanged.Value still equals 0. Good luck!
Ken.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,734
Messages
2,569,441
Members
44,832
Latest member
GlennSmall

Latest Threads

Top