Check for form changes

  • Thread starter Thread starter JIK
  • Start date Start date
J

JIK

Hi.

I have a web app written in ASP.NET/C# with a lot of textboxes, dropdowns
etc.
Is there any possibilities to check for changes in texboxes etc in a web
form on the client side easily?
And on the server side?


Jon
 
Client side is good old JavaScript... there's nothing about ASP.NET that
will help you there.

Server side, however, ASP.NET can help! You could take advantage of the
"Change" events for your ASP.NET controls... if the event (or events) fire,
then you know the values have been changed. You can even tie multiple events
(the change event for each control) to a single event handler to centralize
the processing of the events.

Corey O'Mara
MCSD.NET, MCT
 
Thanks - but...

I know I have to use Java on the client side - is it any easy way to
check if the user have done any changes?

On the server side - by using the Change event - will it then do a
roundtrip from client to server for every change the user makes?



Jon
 
There's no "easy" way that I know of to write that Javascript (has it ever
been easy?).

As for the server side, the page won't make a roundtrip for every change the
user makes unless you have a control's "AutoPostBack" property set to true.
If not, the server side events will fire when the page does a round trip
based on the user pressing a button, etc.
 
Thanx,

Do you, or anyone, have som samples of java-code to use?
I want to have code that checks for changes and waarn the user if he try to
navigate away from the page without saving...


Jon
 
Back
Top