1-888-365-2779
+1-888-365-2779
Try Now
More in this section

Forums / Developing with Sitefinity / Anchor Tags and Master Pages

Anchor Tags and Master Pages

2 posts, 0 answered
  1. Armysniper
    Armysniper avatar
    126 posts
    Registered:
    03 Mar 2005
    13 Aug 2009
    Link to this post
    I have a log at the top of my page, which when clicked should return the user to the home. I have the anchor tag set like this (image is displayed by the div)... 

     

    <div id="logo">  
       <h1> 
          <href="~/Default.aspx"><span>My Site</span></a>  
       </h1> 
    </div> 

    It does not work...it tries to go to http://localhost/MySite/~/Default.aspx. How can i get this to work so it always goes to the root of my site?

     

     

     

     

     

     

     

     

  2. LBrinley
    LBrinley avatar
    59 posts
    Registered:
    29 Dec 2005
    13 Aug 2009
    Link to this post
    Your code block needs to be as follows:

    <div id="logo">     
       <h1>    
          <href="~/Default.aspx" runat="server"><span>My Site</span></a>  
       </h1>    
    </div>    
     

    The runat="server" addition to the anchor tag will instruct .NET to dereference the ~/ to your application root and create the http://www.mysite.com/Default.aspx url you're looking to achieve.
2 posts, 0 answered