Help me. I'm stuck with this web control problem....

Discussion in 'ASP .Net Web Controls' started by Henry, Dec 29, 2004.

  1. Henry

    Henry Guest

    I have this problem and I don't know what I can do. First of all, I have a
    page with [ok] and [cancel] button, and 5 <asp:TextBox>'s and when an user
    makes changes to each of the textbox content, javascript client side code is
    triggered to change the textbox background color property to some other
    color. My problem is when I click on the save button(server side), I get a
    pop up window (like a message box but it's just a another browser) that ask
    if you would like to save. At this point, if [cancel] is selected, the window
    will close and the original page with those textbox will show. However, all
    the colors that were changed by client side code is now lost because of
    postback to server. Is there anyway to keep the textbox control's property
    such as (textbox1.style.backgroundColor) when performing postback. What I
    tried so far is to store each of the control's name in hidden value
    ("textbox1;textbox4") but, can't do anything about it further once I have it
    on the server side. Is there any other way to achieve this. Any help would
    be appreciated. Thanks.

    Henry
    Henry, Dec 29, 2004
    #1
    1. Advertising

  2. "Henry" <> wrote in message
    news:...
    >I have this problem and I don't know what I can do. First of all, I have a
    > page with [ok] and [cancel] button, and 5 <asp:TextBox>'s and when an user
    > makes changes to each of the textbox content, javascript client side code
    > is
    > triggered to change the textbox background color property to some other
    > color. My problem is when I click on the save button(server side), I get
    > a
    > pop up window (like a message box but it's just a another browser) that
    > ask
    > if you would like to save. At this point, if [cancel] is selected, the
    > window
    > will close and the original page with those textbox will show. However,
    > all
    > the colors that were changed by client side code is now lost because of
    > postback to server. Is there anyway to keep the textbox control's
    > property
    > such as (textbox1.style.backgroundColor) when performing postback. What I
    > tried so far is to store each of the control's name in hidden value
    > ("textbox1;textbox4") but, can't do anything about it further once I have
    > it
    > on the server side. Is there any other way to achieve this. Any help
    > would
    > be appreciated. Thanks.


    Don't just store the control name - also store the color you changed it to.
    Then, in the ServerChange event handler of the HtmlInputHidden control, you
    can change the color of the textbox.

    John Saunders
    John Saunders, Dec 30, 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. James N

    Stuck with launching IE from Web App

    James N, Oct 26, 2004, in forum: ASP .Net
    Replies:
    2
    Views:
    381
    James N
    Oct 26, 2004
  2. Alan Silver
    Replies:
    8
    Views:
    383
    Alan Silver
    Feb 22, 2005
  3. Paul Schouten
    Replies:
    2
    Views:
    2,424
    Vladimir Khvostov
    Jan 3, 2005
  4. Midway

    Really Stuck on a Canlendar Control PLEASE HELP!!!

    Midway, Aug 31, 2006, in forum: ASP .Net Web Controls
    Replies:
    6
    Views:
    139
  5. Ryan
    Replies:
    0
    Views:
    104
Loading...

Share This Page