嗨朋友们, 我正在用C#VS 2013开发网页项目。 i给菜单提供URL链接。 i有以下菜单: 主页,课程,申请表,联系方式 菜单网址: 首页 - > /默认 课程 - > / PageInfo /课程 申请 - > / PageInfo /申请 联系 - >> /联系 以下是我的Routeconfig代码
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
// 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 );如果我点击课程页面,URL自动更改如下: 主页 - > PageInfo /默认 课程 - > PageInfo / PageInfo /课程 应用程序 - > PageInfo / PageInfo / Application 联系人 - > PageInfo /联系 任何人都知道为什么URL与其他人联系这个。 我的菜单代码
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
<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>推荐答案
{PageInfo}部分将获得来自客户端的href属性值,所以当你在href中有PageInfo / Course时,它似乎复制了PageInfo ... 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...
更多推荐
VS2013中的URL连接
发布评论