ASP.Net : Who am I?


I often require to know the script name currently executing to display certain features depending on page. For this I use this code for detecting the script name of the page that is executing ….

Dim str As String
str = Request.ServerVariables(“SCRIPT_NAME”)
Dim allname() As String
allname = str.Split(“/”)

If allname(allname.GetUpperBound(0)) = “register.aspx” Then
LoginBox1.Visible = False
End If

Run this code in Forms Page Load event to display controls you need to display or not…

-Sumit Gupta