Form state change

Discussion in 'ASP .Net' started by Anatoli Trifonov, Oct 17, 2004.

  1. 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
    Anatoli Trifonov, Oct 17, 2004
    #1
    1. Advertising

  2. 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.

    --
    Ken Dopierala Jr.
    For great ASP.Net web hosting try:
    http://www.webhost4life.com/default.asp?refid=Spinlight
    If you sign up under me and need help, email me.

    "Anatoli Trifonov" <> wrote in message
    news:...
    > 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
    >
    >
    Ken Dopierala Jr., Oct 17, 2004
    #2
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. David Lamb
    Replies:
    1
    Views:
    680
  2. Weng Tianxiang
    Replies:
    7
    Views:
    1,105
    Mike Treseler
    Nov 25, 2003
  3. shamanthakamani
    Replies:
    1
    Views:
    3,491
    Natty Gur
    Nov 20, 2003
  4. Not Liking Dot Net Today
    Replies:
    0
    Views:
    609
    Not Liking Dot Net Today
    Apr 21, 2004
  5. Vinay Joseph Mathew

    Losing Session State on a State Server

    Vinay Joseph Mathew, Aug 10, 2004, in forum: ASP .Net
    Replies:
    3
    Views:
    600
    =?Utf-8?B?c29ubnk=?=
    Sep 16, 2004
Loading...

Share This Page