all groups > asp.net building controls > january 2004 >
You're in the

asp.net building controls

group:

How to detect a modified textbox in webservercontrols


How to detect a modified textbox in webservercontrols ton
1/28/2004 12:02:11 PM
asp.net building controls:
Hi,
I've developed a server control which shows a database record. The fields
are showen in 2 columns and the added controls depends on the datatype.
I use textboxes, chekcboxes and dropdownlists

Now I'm adding a server procedure, but how can I detect that one of the
fields has been modified.
Is there another way than just comparing these fields with the original
value in the database.

Ton

Re: How to detect a modified textbox in webservercontrols ton
1/28/2004 1:22:59 PM
for those who do not understand what I meant the procedure is to SAVE the
data

Now I'm adding a SAVE procedure

"ton" <vrs@home.nl> schreef in bericht
news:bv85e1$41c$1@news3.tilbu1.nb.home.nl...
[quoted text, click to view]

Re: How to detect a modified textbox in webservercontrols Alessandro Zifiglio
1/29/2004 7:03:57 PM
hi ton, when processing postback data you can compare the old fields with
the new fields and if changed fire an event. This can be done by having your
control implement the IPostBackDataHandler interface.
For a control to be able to examine form data that is posted back by the
client, it must implement the System.Web.UI.IPostBackDataHandler interface.
The contract of this interface allows a control to determine whether its
state should be altered as a result of the postback and to raise appropriate
events.
More with sample code here :
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpguide/html/cpconpostbackdataprocessingsample.asp

[quoted text, click to view]

AddThis Social Bookmark Button