I need a way to force a page to reload or reload in codebehind. I tried using some kind of javascript, but did not get it to work. Browse the network. I see the first question: βwhy?β
The circumstances are that I have a drop-down list for autostart, and the gridview datasource selector is from the selected value of this drop-down list. Thus, the page works fine and the content is refreshed whenever the selected item is changed. But some links and buttons distract the client from the page, so they link later.
The idea is to save the last selection in the session and check the first page.load event if the session parameter is different from the default. Now I can change the selected index of the drop-down list based on this, but apparently the data source starts faster than page.load, so if I can not force the reload, it will not help.
Any ideas? A full postback / reload page is not the only option, of course, just forcing gridview / datasource to be updated quite well. I just donβt know how to do this other than reloading the whole page.
Thanks.
source
share