Showing posts with label state. Show all posts
Showing posts with label state. Show all posts

Wednesday, March 28, 2012

Difficult to disable ClientState in User Control

Not sure there's a solution for this, but I find it overly difficult to disable the client state field. I'm using HTTP Get for my post, and I have a textbox watermark extender on a field. I don't want the ClientState because it makes my URLs look bad. So I have to set EnableClientState to false BEFORE the client state hidden control is actually set. In a user control, I don't think I get any chance to do this. (The debugger says I don't see OnInit before the contained TextBoxExtender does, and there's no PreInit for the control).

So my only choice would be to derive from TextBoxWatermarkExtender. Not the end of the world, but I don't think it's what was intended. Thoughts?

Your idea about deriving from TBW seems pretty reasonable to me. Any objections?
Yeah, it's an awfully heavy price to pay for simply setting a property. I would much prefer to see this in the core classes.

Difficult problem with the UpdatePanel and State

Hi,

I have a page with an UpdatePanel that display 5 news story headlines, within the UpdatePanel there are two buttons, back and next, to move the to the next 5 headlines set or to move previous 5 headlines set. Each headline has a link that goes to a new page where the full news story is shown. All this is working great, but if the user is on the second or third set of headlines, then clicks on one of the headlines to go to the page that shows the entire news story, then the user click the back button on the browser to get back to the news story headlines, the news story headlines page will display the first set of news story headlines, not the second or third set where the user originally left from.

How I can let the news story headlines page or the UpdatePanel know on which set the user left the page, so when the user came back via the back browser button, the set they left is displayed?

Hope this makes sense! Thank you.

Please, let me know if I should explain this better or differently, need help with it!