user1055487 user1055487 -4 years ago 140
Vb.net Question

ASP.NET - Response redirect to different folder

I am attempting to redirect a gridview on selection. However, I am getting stuck on redirection when the page I am trying to redirect to is in a different folder.

The gridview is in a folder named HR. I am trying to redirect this to a file called Staff within a folder called Staff (Staff\Staff). How can I redirect to a different folder?

If e.CommandName = "Select" Then
'Add to session variable; translate the index of clicked to Primary Key
Session.Add("DetailsKey", GridView1.DataKeys(e.CommandArgument).Value.ToString)
Response.Redirect("staff\staff.aspx")
End If

Answer Source
Response.Redirect("~/staff/staff.aspx")
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download