Here is a nice piece of code to get the file name of the current page that is being viewed. For the purpose of illustration, I'm using some altered code from one of my web applications. This code is being used in the master page to set a session variable only when I'm on a certain content page.
If System.IO.Path.GetFileName(HttpContext.Current.Request.FilePath).ToLower = "secure.aspx" Then Session.Item("MyVariable") = "window_onload();" Else Session.Item("MyVarible") = "" End If If I'm on any other page, I want the session variable cleared. |