R
Rob Meade
Hi all,
I've tried to add a hyperlink object inside a label object and its not
having any of it...any ideas?
Code below..
' Declare variables
Dim Link As Hyperlink
' Create a new hyperlink instance
Link = New HyperLink
' Set the properties for our hyperlink
Link.NavigateUrl = "../Default.aspx"
Link.CssClass = "horizontalNavigationText"
Link.ToolTip = "Home"
' Add our home hyperlink
lblNavigation.Controls.Add(Link)
After this I then add some text to it...
lblNavigation.Text = " \ Weddings"
The end result should look like this:
Home \ Weddings
with the Home being a hyperlink back to default.aspx etc
I had this previously by setting the text to equal all of the html needed,
ie
lblNavigation.Text = "<a href=""default.aspx"" title=""Home"">Home</a>"
which work but I guessed it wasn't really the best way to do it (typical
that that worked and the new way doesnt!)..
I've added the hyperlinks like the new way above within table cells before
and they've been fine - not tried a label before - can it be done?
Any help appreciated,
Regards
Rob
I've tried to add a hyperlink object inside a label object and its not
having any of it...any ideas?
Code below..
' Declare variables
Dim Link As Hyperlink
' Create a new hyperlink instance
Link = New HyperLink
' Set the properties for our hyperlink
Link.NavigateUrl = "../Default.aspx"
Link.CssClass = "horizontalNavigationText"
Link.ToolTip = "Home"
' Add our home hyperlink
lblNavigation.Controls.Add(Link)
After this I then add some text to it...
lblNavigation.Text = " \ Weddings"
The end result should look like this:
Home \ Weddings
with the Home being a hyperlink back to default.aspx etc
I had this previously by setting the text to equal all of the html needed,
ie
lblNavigation.Text = "<a href=""default.aspx"" title=""Home"">Home</a>"
which work but I guessed it wasn't really the best way to do it (typical
that that worked and the new way doesnt!)..
I've added the hyperlinks like the new way above within table cells before
and they've been fine - not tried a label before - can it be done?
Any help appreciated,
Regards
Rob