0

I have a hyperlink as below :

<asp:TemplateField ControlStyle-CssClass="hlink" HeaderText="LOG LINK" ItemStyle-Width="6%" ItemStyle-Font-Underline="true" >
                <ItemTemplate>
                    <asp:HyperLink ID="lnk" runat="server" Target="_blank" Text='Link' NavigateUrl='<%# ((string)Eval("logLink")).Replace("server","myserv") %>'></asp:HyperLink>
                </ItemTemplate>
            </asp:TemplateField>

The situation is as below :

Normally,when you hover over a link your select arrow changes to the hand arrow telling the user this is clickable. (This is happening correctly)

Also,when you hover on the link ,in the bottom left of the browser you get a small tooltip sort of thing which shows the url you will be directed to if you click on the link.

I am getting the correct url with the string replaced as desired.

But when I click on the link nothing is happening.

Its very weird. I tried copying the url and pasting it directly on my browser,that works fine but when I click the same url from the link,nothing is happening.

If the question is not understood properly,please post it on the comment.

Any idea anyone?

user1698232
  • 183
  • 2
  • 5
  • 20

1 Answers1

0

You have specified Target="_blank" which means "open in a new window". You also say that if you copy the URL it works. This can mean only one thing - the problem is your pop-up blocker. Check top-right corner of your browser to see whether the pop-up was blocked.

There is a nice walkthrough for all browsers.

EDIT: During the chat we've discovered that user1698232 is generating links to files.

file://192.168.1.1/Logs/file.xml

Those links just don't open for security reasons. Here are the related articles:

  1. How to create a hyperlink to shared network directory or file?

  2. HTML links to local network shares

Community
  • 1
  • 1
rocky
  • 7,506
  • 3
  • 33
  • 48
  • Hi rocky ! No,the pop-up isn't blocked.Atleast,there is no symbol on the browser that shows it is blocked. – user1698232 Mar 01 '15 at 15:01
  • I think you have misunderstood the question.The url which the link is directing to is NOT a popup – user1698232 Mar 01 '15 at 15:04
  • Then try to set Target="_self"... (Check out http://www.w3schools.com/tags/att_a_target.asp) – rocky Mar 01 '15 at 15:05
  • Tried that.No success :/ – user1698232 Mar 01 '15 at 15:06
  • where do u think the problem may lie ? – user1698232 Mar 01 '15 at 15:09
  • Can you tell us which browser are you using? + Paste a snippet of the rendered HTML (CTRL+U to view the source in most browsers)... The problem might be some javascript blocking clicks to your link or some browser extension... – rocky Mar 01 '15 at 15:10
  • Can you try to run your browser with extensions turned off? (http://www.addictivetips.com/windows-tips/how-to-start-firefox-and-internet-explorer-without-add-ons/) – rocky Mar 01 '15 at 15:10
  • Let us [continue this discussion in chat](http://chat.stackoverflow.com/rooms/71986/discussion-between-user1698232-and-rocky). – user1698232 Mar 01 '15 at 15:10