Swaroop
Swaroop

Reputation: 21

How to redirect a again on the same page with out hard-coding in asp.net?

My page has a cancel button, and when I click on it, I want to redirect to the same page. How do I do that?

This is a very big page with wizard controls and view states. I need reload the page, then I can clear viewstate. So, please tell me how to redirect to the same page when I click on the cancel button.

Upvotes: 0

Views: 7886

Answers (2)

Samich
Samich

Reputation: 30115

this.Response.Redirect(this.Request.Url.ToString());

Upvotes: 4

Madhur Ahuja
Madhur Ahuja

Reputation: 22681

 Response.Redirect(Request.Path);  
    Response.Redirect(Request.RawUrl);  
    Response.Redirect(Request.Url.ToString());

Upvotes: 1

Related Questions