| | |
Posting Back Twice--Setting Theme with DropDown
![]() |
•
•
Join Date: Jul 2006
Posts: 47
Reputation:
Solved Threads: 0
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?
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?
![]() |
Other Threads in the ASP.NET Forum
- Previous Thread: Common Chatting in asp.net
- Next Thread: Problem in displaying thumb image in data list using paging concept
Views: 921 | Replies: 1
| Thread Tools | Search this Thread |
Tag cloud for ASP.NET
.aspx .net 2.0 3.5 activexcontrol ajax alltypeofvideos asp asp.net asp.net-books asp.net-security bc30451 bottomasp.net browser button c# chat checkbox click commonfunctions connectionstring control countryselector crystal dataaccesslayer database datagridview datagridviewcheckbox datalist development dgv directory domain dropdownmenu edit expose feedback findcontrol flash folder form form-auth-subdomain form-authentication formatdecimal forms gridview identity iframe iis images impersonation index insert javascript john-raasch json learn-asp.net list location-web-config login maps masterpage menu mobile mono mssql mvc navigation numerical panelmasterpagebuttoncontrols parent problem profile redirect relationaldatabases save search security server session silverlight simple software sql suse tracking translate-site treeview update url validation vb.net view vista visual visual-studio visualstudio web website xml





