newbie hyperlink question

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
 
P

Patrick.O.Ige

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

thersitz

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.
 
T

thersitz

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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,994
Messages
2,570,223
Members
46,812
Latest member
GracielaWa

Latest Threads

Top