Search code examples
asp.netbuttonclickback

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 ?


Solution

  • 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 ...