VS2013中的URL连接

编程入门 行业动态 更新时间:2024-10-11 09:29:17
本文介绍了VS2013中的URL连接的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

嗨朋友们, 我正在用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连接

本文发布于:2023-11-08 06:25:09,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1568588.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:URL

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!