Hi,
I have a series of links that I want to be visible only when the url is equal to a certain address. I am using the asp:hyperlink control with unique ids. In my code behind I have:
Inherits System.Web.UI.UserControl
Protected Sub Page_Load(ByVal sender as Object, ByVal e As System.EventArgs) Handles Me.Load
Dim serverURL As string
If serverURL = " Then
hyperlinkID.Visible = False
Else
hyperlinkID.Visible = True
End IF
End Sub
My question is that this code worked once but now I am receiving an error that my hyperlinkID needs to be declared. Since it is an id of a control how would I declare it, or is there something else wrong? Also how would I incorporate using the Request.Url.ToString to get the url of the page a person is on dynamically? I do not want to hard code it.
Since request is not part of the System.Web.UI.UserControl I receive an error. I have looked at several tutorials for .net and understand them but when I go to write code I am completely lost and overwhelmed...please help.
I have a series of links that I want to be visible only when the url is equal to a certain address. I am using the asp:hyperlink control with unique ids. In my code behind I have:
Inherits System.Web.UI.UserControl
Protected Sub Page_Load(ByVal sender as Object, ByVal e As System.EventArgs) Handles Me.Load
Dim serverURL As string
If serverURL = " Then
hyperlinkID.Visible = False
Else
hyperlinkID.Visible = True
End IF
End Sub
My question is that this code worked once but now I am receiving an error that my hyperlinkID needs to be declared. Since it is an id of a control how would I declare it, or is there something else wrong? Also how would I incorporate using the Request.Url.ToString to get the url of the page a person is on dynamically? I do not want to hard code it.
Since request is not part of the System.Web.UI.UserControl I receive an error. I have looked at several tutorials for .net and understand them but when I go to write code I am completely lost and overwhelmed...please help.