Solved

Simple Hyperlink not working

Posted on 2013-01-08
11
200 Views
Last Modified: 2013-02-04
I have a simple horizontal navigator that contains 6 links.  In my local environment I'm able to redirect from page to page.  On host server nothing happens. this code resides in my masterpage calling files that exist on the root directory. Please see code below.  Any suggestions is appreciated.

                <!--Begin Navigator Bar -->
                <!--This section contains the Website Navigator -->
                <div id="navbar">
                    <ul id="topnav">
                        <li><asp:HyperLink ID="DefaultHome" runat="server" NavigateUrl="../Default.aspx" ToolTip="HOME" Text="HOME" /></li>
                        <li><asp:HyperLink ID="DefaultBio" runat="server" NavigateUrl="../Bio.aspx" ToolTip="About Robert Debonairé" Text="About Robert Debonairé" /></li>
                        <li><asp:HyperLink ID="DefaultMusic" runat="server" NavigateUrl="../Music.aspx" ToolTip="About The Music" Text="About The Music" /></li>
                        <li><asp:HyperLink ID="DefaultMedia" runat="server" NavigateUrl="../Pictures.aspx" ToolTip="PICTURES" Text="Pictures" /></li>
                        <li><asp:HyperLink ID="DefaultBlog" runat="server" NavigateUrl="" ToolTip="BLOG" Text="Robert's BLOG" /></li>
                        <li><asp:HyperLink ID="DefaultShow" runat="server" NavigateUrl="../Show.aspx" ToolTip="SHOWS" Text="SHOWS" /></li>
                        <li><asp:HyperLink ID="DefaultContact" runat="server" NavigateUrl="" ToolTip="CONTACT US" Text="CONTACT" Visible="false" /></li>
                    </ul>
                </div><!--End Navigator Bar-->
0
Comment
Question by:Robert Treadwell
  • 6
  • 4
11 Comments
 
LVL 33

Expert Comment

by:paulmacd
ID: 38755889
Only one of your ASP:Hyperlinks actually contains a path to a file.  That said try...
     NavigateUrl="/Bio.aspx"
...or...
     NavigateUrl="~/Bio.aspx"
...and see if that solves your problem
0
 

Author Comment

by:Robert Treadwell
ID: 38756131
Thank you for your reply.  I had tried both of those previously and again after your post.  On the host server links still aren't working.  Unsure why?  I would hate to have to use linkbuttons because that will make a call to backend code but I know that works.
0
 

Author Comment

by:Robert Treadwell
ID: 38756266
Update, tried using linkbutton and it didn't work either. Has to be something on host server.
0
 
LVL 33

Expert Comment

by:paulmacd
ID: 38756385
It's almost certainly a pathing issue.  When deployed on the server, what path does the hyperlink show when you hover over it?  Alternately, you can right-click and "view source."

In Visual Studio, do you have the "Virtual path" set to "/" (root)?
0
 

Author Comment

by:Robert Treadwell
ID: 38756718
I believe your correct.  I change the code to know call backend script to redirect, which doesn't work so the code now looks like this;  before then the href="Bio.aspx" for example.


                <!--This section contains the Website Navigator -->
                <div id="navbar">
                    <ul id="topnav">
                        <li><a id="ctl00_DefaultHome" title="HOME" href="javascript:__doPostBack('ctl00$DefaultHome','')" style="text-decoration:none;">HOME</a></li>
                        <li><a id="ctl00_DefaultBio" title="About Robert Debonairé" href="javascript:__doPostBack('ctl00$DefaultBio','')" style="text-decoration:none;">About Robert Debonairé</a></li>
                        <li><a id="ctl00_DefaultMusic" title="About The Music" href="javascript:__doPostBack('ctl00$DefaultMusic','')" style="text-decoration:none;">About The Music</a></li>
                        <li><a id="ctl00_DefaultMedia" title="PICTURES" href="javascript:__doPostBack('ctl00$DefaultMedia','')" style="text-decoration:none;">Pictures</a></li>
                        <li><a id="ctl00_DefaultBlog" title="BLOG" href="javascript:__doPostBack('ctl00$DefaultBlog','')" style="text-decoration:none;">Robert's BLOG</a></li>
                        <li><a id="ctl00_DefaultShow" title="SHOWS" href="javascript:__doPostBack('ctl00$DefaultShow','')" style="text-decoration:none;">SHOWS</a></li>
                        <li></li>
                    </ul>
0
Free Trending Threat Insights Every Day

Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

 
LVL 33

Expert Comment

by:paulmacd
ID: 38756838
So all these files sit in the root of the site?  Even the master page?  

How about...
     NavigateUrl="Bio.aspx"
...or...
     NavigateUrl="./Bio.aspx"
0
 

Author Comment

by:Robert Treadwell
ID: 38757615
No the master resides in a folder: /MasterPages/RDMaster.master
0
 
LVL 33

Expert Comment

by:paulmacd
ID: 38757706
Try the changed NavigateURLs, then try putting the master page in the root of the web site.
0
 
LVL 1

Expert Comment

by:jinsonaf
ID: 38758385
Is your *.aspx handiler enabled in the iis of server? That too may be an issue.
0
 

Accepted Solution

by:
Robert Treadwell earned 0 total points
ID: 38837778
The issue was resolved by changing security parameters on the folders where aspx pages reside.
0
 

Author Closing Comment

by:Robert Treadwell
ID: 38850500
This resolution solved my problem
0

Featured Post

Why You Should Analyze Threat Actor TTPs

After years of analyzing threat actor behavior, it’s become clear that at any given time there are specific tactics, techniques, and procedures (TTPs) that are particularly prevalent. By analyzing and understanding these TTPs, you can dramatically enhance your security program.

Join & Write a Comment

I recently went through the process of creating a Calendar Control of events with the basis of using a database to keep track of the dates that are selectable, one requirement was to have the selected date pop-up in a simple lightbox.  At first this…
It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
This video discusses moving either the default database or any database to a new volume.
This video demonstrates how to create an example email signature rule for a department in a company using CodeTwo Exchange Rules. The signature will be inserted beneath users' latest emails in conversations and will be displayed in users' Sent Items…

707 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

14 Experts available now in Live!

Get 1:1 Help Now