locked
Can anyone help me with Image link RRS feed

  • Question

  • Hi Everyone,

    I am trying to make an image link in my Windows8 app. My code is like this:

    <a href="help.html"> <img src='/images/help.png' height="150" width="150"/> </a>

    I am not hosting the help. html page in any server. I am still building but the problem is that I cannot make the link work. Even if the image shows up, the image link does not work at all.

    Please help me.

    Thank you


    9seconds

    Tuesday, May 7, 2013 5:04 PM

Answers

  • I tried this and it worked for me :

    <a href="help.html"> <img src='/images/logo.png' height="150" width="150"/> </a>

    Are you sure your "help.html" is in the same folder as the HTML where you are specifying this above syntax. (Default is where I use the above syntax) 

    See the below screenshot (first one), I have the default.html and help.html at the same folder (in the project root folder).

    They should be in the same folder else you will have to mention the relative path as

    href="<SomeFolder>/help.html

    For example : if I want to access the file in another folder (see screenshot 2) I use this code:

    <a href="SamplePages/help.html"> <img src='/images/logo.png' height="150" width="150"/> </a>

    Hope this helps.

    - Girija

    Tuesday, May 7, 2013 10:01 PM

All replies

  • I tried this and it worked for me :

    <a href="help.html"> <img src='/images/logo.png' height="150" width="150"/> </a>

    Are you sure your "help.html" is in the same folder as the HTML where you are specifying this above syntax. (Default is where I use the above syntax) 

    See the below screenshot (first one), I have the default.html and help.html at the same folder (in the project root folder).

    They should be in the same folder else you will have to mention the relative path as

    href="<SomeFolder>/help.html

    For example : if I want to access the file in another folder (see screenshot 2) I use this code:

    <a href="SamplePages/help.html"> <img src='/images/logo.png' height="150" width="150"/> </a>

    Hope this helps.

    - Girija

    Tuesday, May 7, 2013 10:01 PM
  • I gave as an example. I assigned right path. When I click the link I am getting something like this : Whenever I click the image link, whole background turns like this. Do you know what is the problem with my app.


    9seconds

    Tuesday, May 7, 2013 11:19 PM
  • I forgot to thank you for your reply. Thank you so much for your fast reply.

    9seconds

    Tuesday, May 7, 2013 11:20 PM
  • I am not sure what's happening here.. Does this happen if you create a new project ?

    - Girija

    Tuesday, May 7, 2013 11:26 PM
  • In the new project, I am not getting this error. But it happened last time in my two apps. I could not fix and finally I got tired and removed image link and had to put text link. It happens when I put content in the apps like navigation buttons and app bar. I will try to figure out making more than 2 test apps and find what changes I am making that causes such problems.

    Thank you for your fast reply.


    9seconds

    Tuesday, May 7, 2013 11:35 PM
  • Hi,

    You should remove the Href and use the navigate function. this is safe and you can pass values to the page in case you want to.

    - Girija

    Tuesday, May 7, 2013 11:41 PM
  • Its more JavaScript. I will try to change the navigation function. I think it will be much safer. I have one more question for you, do you have knowledge about how to put image slide show in our apps. I could make image slide show inside my app. The same javascript works in the browser but does not work in WinApps.

    9seconds

    Tuesday, May 7, 2013 11:46 PM
  • Hi,

    Check this out http://msdn.microsoft.com/en-us/library/windows/apps/hh770876.aspx

    Also you could leverage the FlipView and then write a code (with timeout) to iterate over the items.

    - Girija

    Tuesday, May 7, 2013 11:51 PM
  • Thanks a lot. You are smart man. Is there any fast way to stay connected with you?

    9seconds

    Tuesday, May 7, 2013 11:54 PM