mikrimouse
mikrimouse

Reputation: 287

getting back to folder in asp.net

protected void Button1_Click(object sender, EventArgs e) { Response.Redirect("Page2.aspx"); } this is code to go on .aspx but what if i want to go in Folder in my solution explorer, tried with location but it dont work Who knows post it.

this is location > website\admin -news.aspx -project.aspx and i created in news.aspx button go back to admin, and when i hit button location is next > website\admin\admin why he duplicate admin ?

Upvotes: 0

Views: 1612

Answers (2)

Bhoomi
Bhoomi

Reputation: 80

if you have admin folder in your application then redirect it

Response.Redirect("admin/page.aspx"); or Response.Redirect("~/admin/page.aspx");

if you don't have admin folder in your application then redirect it

Response.Redirect("page.aspx");

Try this all ...

Upvotes: 0

Tom Gullen
Tom Gullen

Reputation: 61775

Response.Redirect("~/Folder/Page.aspx");

The tilde ~ is very useful for redirects, it signifies your site root. So wherever you are on the site, you can redirect to folders relative to the domain root. I hope this is what you meant!

Upvotes: 1

Related Questions