Kevin
Kevin

Reputation: 1240

Reload a Web Page Using C#

I have a web page that prompts for user input via DropDownLists in some table cells. When a selection is made the selection replaces the DropDownList so that the action can only be performed once. In the case that a change needs to be made I want to be able to click a button that reloads the page from scratch. I have Googled and Googled but I have not managed to find a way to do this.

Any advice is appreciated.

Regards.

Upvotes: 0

Views: 138

Answers (2)

David
David

Reputation: 73594

Put a link on the page with the text "Reload" and the url the url of the page. It's perfectly valid to have a page with a link to itself.

If you don't like the link idea, use a standard Button and in the click event, use Response.Redirect to redirect to the current page.

Upvotes: 3

dmi_
dmi_

Reputation: 1257

You can set an OnClick for your button that resets each DropDownList's SelectedIndex to 0 instead of reloading the page from scratch. Alternatively, you can set a Response.Redirect([the page's url]) into the OnClick as is suggested here.

Upvotes: 0

Related Questions