Solved

Simple Hyperlink not working

Posted on 2013-01-08
11
203 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 34

Expert Comment

by:Paul MacDonald
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
Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 
LVL 34

Expert Comment

by:Paul MacDonald
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
 
LVL 34

Expert Comment

by:Paul MacDonald
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 34

Expert Comment

by:Paul MacDonald
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

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Introduction This article shows how to use the open source plupload control to upload multiple images. The images are resized on the client side before uploading and the upload is done in chunks. Background I had to provide a way for user…
Problem Hi all,    While many today have fast Internet connection, there are many still who do not, or are connecting through devices with a slower connect, so light web pages and fast load times are still popular.    If your ASP.NET page …
In an interesting question (https://www.experts-exchange.com/questions/29008360/) here at Experts Exchange, a member asked how to split a single image into multiple images. The primary usage for this is to place many photographs on a flatbed scanner…

762 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