I have two pages in my root directory
1. Default.aspx (login page)
2. Home.aspx
and also one folder Attachments where i store the attachment files, from Home.aspx user can download the attachments. In order to prevent user from viewing Directory listing i add one more aspx page in this directory.
1. Root/Attachments/Default.aspx
now i want to Redirect the user to login page (Root/Default.aspx) from Root/Attachments/Default.aspx.
How this could be done.
1
votes
Response.Redirect("../Default.aspx");
– Bayu Alvian
1 Answers
3
votes
There are a couple things you can do:
Response.Redirect("~/Default.aspx")
- disable directory browsing in IIS also make sure that Default.aspx is a default document.
If you do the second option, you could then change your redirect to Response.Redirect("~/")
.