Re: Question on textbox property.
From: Steve Lutz (slutz_at_nospam.comcast.net)
Date: 12/30/04
- Next message: thomson: "Converting Excel File to pdf"
- Previous message: Steve Lutz: "Re: COM Interop messes with IE hosted windows forms control"
- In reply to: Henry: "Question on textbox property."
- Messages sorted by: [ date ] [ thread ]
Date: Wed, 29 Dec 2004 23:09:58 -0500
Alternatively, you could write Javascript code that gets run on Window's
OnLoad event. This will "re-play" the color coding of the text boxes based
on the current values. Does the server NEED to know about the color changes?
If so, this approach will not work.
Also, when you change the colors, you could also write cookies in
Javascript. When posting back, the cookies will be sent to the server. The
page then needs to read the cookies determine the colors. This approach will
work if it's required that the server know about the color coding. You can
do a quick google on something like "write cookie javascript" to get sample
code on writing the cookies.
Hope that helps
Steve
"Henry" <Henry@discussions.microsoft.com> wrote in message
news:814EB9E4-3C76-4A9F-9CD6-CCA1143E5628@microsoft.com...
> Hi. I've also posted this at another discussion board and here is the
> original question.
>
> -------------------------
> "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
>
- Next message: thomson: "Converting Excel File to pdf"
- Previous message: Steve Lutz: "Re: COM Interop messes with IE hosted windows forms control"
- In reply to: Henry: "Question on textbox property."
- Messages sorted by: [ date ] [ thread ]