Click here to Skip to main content
16,021,125 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
I have googled it also and checked many sites also Can anybody help me on this.

I want to add .aspx page to hyper link as i want whenever user click on home it get directed to start page mentioned in link below

<asp:HyperLink ID="HyperLink1" runat="server" NavigateUrl="~/StartPage.aspx">Home</asp:HyperLink></li>


What I have tried:

<header>
       <div class="container">
           <div class="row">
           <div class="col-lg-4">
               <img src="company-logo.png" />
           </div>
           <div class="col-lg-8">
               <div class="top-nav">
                   <nav class="navbar pull-right">
                       <ul class="nav navbar-nav">
                         <li class="active"><%--<a href="StartPage.aspx">Home</a>--%> <asp:HyperLink ID="HyperLink1" runat="server" NavigateUrl="~/StartPage.aspx">Home</asp:HyperLink></li>
                         <li><a href="http://www.veridic.in/veridic-aboutus.html">About US</a></li>
                         <li><a href="http://www.veridic.in/veridic-contact.html">Contact Us</a></li>
                       </ul>
                   </nav>
               </div>
           </div>
           </div>
       </div>
   </header>
Posted
Updated 30-Jun-17 0:17am
Comments
Karthik_Mahalingam 30-Jun-17 5:08am    
what is the issue?
is the startpage.aspx present in root directory?
Member 11644373 30-Jun-17 5:16am    
yes
I want Start page to be get displayed whenever user click on home Text in hyperlink

The answer to your Question might be:

C#
<asp:HyperLink NavigateUrl="StartPage.aspx" Text="Click This" runat="server" />


I Hope this will help you!
 
Share this answer
 
Comments
Member 11644373 30-Jun-17 5:45am    
I am sorry still not working
Prifti Constantine 30-Jun-17 5:51am    
Is the name of the page valid?
Another way of solving the problem is creating a button and on the event the button calls you could try Response.Redirect("StartPage.aspx");
Member 11644373 30-Jun-17 6:14am    
Yes Page name is valid
Prifti Constantine 30-Jun-17 6:23am    
This seems kind of confusing.... Since i tested it and it worked just fine on my project.... In this situation ullas Kottary is right.. Try putting the page inside the same folder.
Your page should be inside the same folder.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900