Click here to Skip to main content
15,896,207 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi Friends,
I am developing web project in C# VS 2013.
i give URL link to menus.
i have the following menus:
Home,Course,Application,Contact
URL for menus:
Home->/Default
Course->/PageInfo/Course
Application->/PageInfo/Application
Contact->/Contact
below is my Routeconfig code
C#
// Register a route for Page/{PageName}
          routes.MapPageRoute(
             "Page Informations",           // Route name
             "PageInfo/{PageInfo}",                  // Route URL
             "~/Page.aspx"              // Web page to handle route
          );

          routes.MapPageRoute(
         "Home Page",           // Route name
         "Home",                  // Route URL
         "~/Default.aspx"              // Web page to handle route
     );
          routes.MapPageRoute(
      "Contactus Page",           // Route name
      "Contact",                  // Route URL
      "~/Contact.aspx"              // Web page to handle route
  );


if i click Course page, the URL automatically changed as following:
Home->PageInfo/Default
Course->PageInfo/PageInfo/Course
Application->PageInfo/PageInfo/Application
Contact->PageInfo/Contact

anyone knows why the URL Concatenate with others like this.
here my menu code
XML
<ul id="nav">
                <li><a href="Default.aspx">Home</a></li>
                <li><a href="PageInfo/Course">Course</a></li>
                <li><a href="PageInfo/faculty">Faculty</a></li>
                <li><a href="PageInfo/Application">Application</a></li>
                <li><a href="ReachUs">Reach Us</a></li>
                <li><a href="Contact.aspx">Contact Us</a></li>
</ul>
Posted

1 solution

The {PageInfo} part will get the href attribute value from the client, so when you have PageInfo/Course in href it seems to duplicate PageInfo...
 
Share this answer
 
Comments
lalitha19 6-May-14 2:40am    
ok. then how can i solve this.could you please explain?now i removed first pageinfo from URL. all links are working fine. but i need to do login page which should be in Admin folder.this problem is affect this login page also.
Kornfeld Eliyahu Peter 6-May-14 11:52am    
You may use authentication element in web.config - http://msdn.microsoft.com/en-us/library/vstudio/532aee0e(v=vs.100).aspx
lalitha19 9-May-14 6:58am    
thanks for your reply. i don't understand the authentication element. there is no problem in vs2010. but vs2013 only have this kind of problem. why it is happened only in vs2013

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