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 ?
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!
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 ...
精彩评论