Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > Detecting values that have changes on a post back

Reply
Thread Tools

Detecting values that have changes on a post back

 
 
Simon Harvey
Guest
Posts: n/a
 
      04-28-2004
Hi all,

Is there any easy way to check a field for calues that have changed on a
post back.

So the page is sent to the user, the user changes some values and I need to
know which ones changed.

Is the only way to do this to go through all the fields and check them
against their old values. In which case, would I need to store the values in
the session object so I could tell what the old values were?

This sounds a bit messy so I'm hoping there is some easier way.

Any help would be greatfully received

Thanks everyone

Simon


 
Reply With Quote
 
 
 
 
Charlie Nilsson [MSFT]
Guest
Posts: n/a
 
      04-28-2004
Search on google for "javascript dirty flag", or something similar. Some
sites use an OnChange attribute in the html input fields, and set a
variable for each field indicating whether than field has been altered.

Basically, each field has its own hidden field, with an initial value=0.
Each input field has its own OnChange event that sets its relative hidden
field value to 1. When the form posts back you just check the hidden
fields to see what changed.

It's not a great solution, but sometimes desirable.

--
CharlieN
VSU

This posting is provided "AS IS" with no warranties, and confers no rights.

Note: For the benefit of the community-at-large, all responses to this
message are best directed to the newsgroup/thread from which they
originated.
--------------------
> From: "Simon Harvey" <(E-Mail Removed)>
> Subject: Detecting values that have changes on a post back
> Date: Wed, 28 Apr 2004 17:12:32 +0100
> Lines: 21
> X-Priority: 3
> X-MSMail-Priority: Normal
> X-Newsreader: Microsoft Outlook Express 6.00.2800.1409
> X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1409
> Message-ID: <#(E-Mail Removed)>
> Newsgroups: microsoft.public.dotnet.framework.aspnet
> NNTP-Posting-Host: firewall.the-web-works.co.uk 217.15.160.2
> Path:

cpmsftngxa10.phx.gbl!TK2MSFTFEED01.phx.gbl!TK2MSFT NGP08.phx.gbl!tk2msftngp13
.phx.gbl
> Xref: cpmsftngxa10.phx.gbl microsoft.public.dotnet.framework.aspnet:229577
> X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet
>
> Hi all,
>
> Is there any easy way to check a field for calues that have changed on a
> post back.
>
> So the page is sent to the user, the user changes some values and I need

to
> know which ones changed.
>
> Is the only way to do this to go through all the fields and check them
> against their old values. In which case, would I need to store the values

in
> the session object so I could tell what the old values were?
>
> This sounds a bit messy so I'm hoping there is some easier way.
>
> Any help would be greatfully received
>
> Thanks everyone
>
> Simon
>
>
>


 
Reply With Quote
 
 
 
 
Simon Harvey
Guest
Posts: n/a
 
      04-29-2004
Thanks for that


 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
UpdatePanel ( url rewrite) 2nd post back url changes Martin ASP .Net 0 04-28-2010 11:47 AM
How does a dynamic control load post back data across post back?? =?Utf-8?B?Z29yaWxsYQ==?= ASP .Net 1 05-25-2007 05:02 AM
[asp] remembering values after postback - changes values Piotrek \Alchemik\ ASP .Net 0 11-12-2006 09:18 PM
how to parse changes to control attributes by javascript at post back Jeremy Chapman ASP .Net 3 02-28-2006 06:35 PM
How can I send back(Post back) some values from client machine Joby ASP .Net 0 05-14-2004 04:19 AM



Advertisments