newbie hyperlink question

  • Thread starter Thread starter thersitz
  • Start date Start date
T

thersitz

Hi,

Just playing around using the QuickStart site. I placed this code in my code
behind:

Sub Page_Load(ByVal sender As Object, ByVal e As EventArgs)
' Set hyperlink to "~", which indicates application root.
link1.NavigateUrl = "~"
End Sub

this code in my page:

<asp:hyperlink ID="link1" runat="server">this link test</asp:hyperlink>

The tutorial has me placing the sub in the page itself -- but shouldn't this
work regardless? It displays the text as a link but hovering over it does
nothing.

thanks
 
Do you want the link to go to another page..
What do you want it to do when you hover over it?
Patrick
 
thanks.

I originally had the file name -- "default.aspx" as the target -- and a file
by that name in the same directory -- but still the link would not activate
on viewing the page -- the style sheet viewed it as a link and applied the
appropiate style but no link functionality upon hovering over it. I have to
run but will try your suggestion first thing in the morn.

thanks for the response.
 
Thanks Patrick.

Well, when I hover over it I expected my cursor to change to a hand pointing
cursor and respond as if it were a regular html link and thus allow me to
click and follow the url assigned to it. It does neither. The style sheet
treats it as a link and formats it accordingly. But hovering over it, the
response is the same as hovering over any non-link text.

I have changed the link1,NavigateURL to "default.aspx" with a file so named
in the same directory as the page. I have changed it to "~/" as per another
suggestion made on this thread. And no go.

So I am missing something fairly fundamental. Any ideas. I took this stuff
right off the asp.net tutorial.
 
Back
Top