My program uses a master page and also has a login.
If a user attempts to open a certain project via a URL link which includes the project id (pid) in the query string and they are not logged in, they will be redirected to the login page. What I want is for the user to then be able to login and then be taken to the page initially requested.
The only problem I am having is that I cannot seem to obtain the part of the query string that I need from when the user enters the URL.
The code I am using is below -
Partial Class MasterPage
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
Dim pid As String = HttpContext.Current.Request.QueryString("pid")
If Session("AccessGranted") = True Then
ASPxMenu1.Visible = True
FullNameLabel.Text = Session("FullName")
FullNameLabel.Visible = True
WelcomeLabel.Visible = True
LogOffASPxButton.Visible = True
ASPxMenu1.Visible = False
FullNameLabel.Visible = False
WelcomeLabel.Visible = False
LogOffASPxButton.Visible = False
If (Session("AccessGranted") = False) And Page.GetType().Name <> "login_aspx" Then
Response.Redirect("~\login.aspx?err=1&pid=" & pid)