Should you visit a page you have no access to, you would be returned to the login page. Unless you enter the credentials of a user who has the rights to view the page, you will keep being returned to the login page. To provide a way out, it is a good idea to add a hyperlink that leads the visitor from the login page to the referring page or at least to a part of the site that is accessible.
With Login.aspx
opened in Design
view, drag and drop a Hyperlink control from the Web Forms Toolbox onto the form as shown in the following figure:
Give the Hyperlink the following properties:
Property |
Value |
|
|
|
|
Double-click on the form to get to its code-behind file. Add logic to the Page_Load()
event handler to populate the NavigateUrl
property of the hyperlink with the URL of the referring page.
private void Page_Load(object sender, System.EventArgs e) { // Put user code to initialize the page here ...