Posting Back Twice--Setting Theme with DropDown

Reply

Join Date: Jul 2006
Posts: 47
Reputation: ChimpusDupus is an unknown quantity at this point 
Solved Threads: 0
ChimpusDupus ChimpusDupus is offline Offline
Light Poster

Posting Back Twice--Setting Theme with DropDown

 
0
  #1
Jun 17th, 2008
Hi,

I have a drop-down list that is used to select a theme (which can only be set in the Page_PreInit event) and so I set a session object called theme that I use to set the theme in the PreInit event. The problem is that on the postback, the PreInit event occurs before the drop-down list is even created and thus before the list's SelectedIndexChanged event that I'm using to set the Session variable. The only thing I can think of doing is somehow doing a second postback so that the page loads again with the new theme setting. A call for this second postback would be in the SelectedIndexChanged event, but I don't know how to refresh the page like that using code.

So basically, how do you refresh/postback the page in code?
Reply With Quote Quick reply to this message  
Join Date: Jul 2006
Posts: 47
Reputation: ChimpusDupus is an unknown quantity at this point 
Solved Threads: 0
ChimpusDupus ChimpusDupus is offline Offline
Light Poster

Re: Posting Back Twice--Setting Theme with DropDown

 
0
  #2
Jun 17th, 2008
Figured it out myself >_<
I just needed a Response.Redirect(); to redirect the browser to the same page
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:




Views: 921 | Replies: 1
Thread Tools Search this Thread



Tag cloud for ASP.NET
About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2010 DaniWeb® LLC