R – asp:how to reload page explicitly

asp.netpostbackrefreshthemes

i have provided a button to change theme of website.in onclick event handler of the button.i am making change in web confif file page section's theme attribute.but on postback theme is not changed untill i do one more postback.so i want to postback pa explicitly in eventhandler of button.

Best Solution

Maybe it is not the best solution, but I know it is possible to do the following:

Server.Transfer(Page.Request.RawUrl)

You need to put that code inside your click event. That way, it will "reload" the page.

But if you change your theme you can do the following to apply it directly to the page:

Page.Theme = "BlueTheme";