原文: https://www.cnblogs.com/bobo-show/p/5746389.html

      https://www.cnblogs.com/zhuji/p/7698057.html

1. @Html.ActionLink()  参考

也是使用在chtml模板中,返回参数中指定controller、指定action的所生成的超链接标签<a>标签html文本.如果没有指定controller,则默认值为本页面对应的Controller.

@model IEnumerable<MvcMusicStore.Models.Genre>
<ul id="categories">
@foreach (var genre in Model)
{
<li>@Html.ActionLink(genre.Name,
"Browse", "Store",
new { Genre = genre.Name }, null)
</li>
}
</ul>

2.Url.Action()

Url.Action() 使用在chtml模板中, 效果是返回的是指定控制器指定action的完整URL地址字符串,不含<a>标签

<a href="<@Url.Action("SelectDetail","OutBox",new{letterid=m.LetterID})>">XXX</a>

3.Url.Content()

<li><a href="@Url.Content("~/StoreManager/")">Admin</a></li>

ASP.NET @URL帮助类的更多相关文章

  1. ASP.NET URL伪静态重写实现方法

    ASP.NET URL伪静态重写实现方法 首先说下,ASP.NET URL伪静态只是将~/a_1.html指向到了~/a.aspx?ID=1,但a.aspx还是真实存在的,你不用./a_1.html来 ...

  2. java中的URL InetAddress类

    /* * InetAddress类: * 用于标识网络上的硬件资源,表示互联网协议(ip)地址,是java对ip地址的封装. * 其实例对象包含以数字形式保存的IP地址,主机名. * InetAddr ...

  3. 【ASP.NET MVC系列】浅谈ASP.NET MVC八大类扩展(上篇)

    lASP.NET MVC系列文章 [01]浅谈Google Chrome浏览器(理论篇) [02]浅谈Google Chrome浏览器(操作篇)(上) [03]浅谈Google Chrome浏览器(操 ...

  4. ASP.NET -- WebForm -- HttpRequest类的方法和属性

    ASP.NET -- WebForm --  HttpRequest类的方法和属性 1. HttpRequest类的方法(1) BinaryRead: 执行对当前输入流进行指定字节数的二进制读取. ( ...

  5. ASP.NET -- WebForm -- HttpResponse 类的方法和属性

    ASP.NET -- WebForm -- HttpResponse 类的方法和属性 1. HttpResponse 类的方法 (1) AddCacheDependency: 将一组缓存依赖项与响应关 ...

  6. asp.net URL传递中文参数System.Web.HttpUtility.UrlEncode与Server.UrlEncode的区别

    asp.net URL传递中文参数System.Web.HttpUtility.UrlEncode与Server.UrlEncode的区别(一) HttpUtility.UrlEncode 方法: 对 ...

  7. asp.net url重写相关技术问题整理

    1.IIS7配置URL重写需要注意系统是32位还是64位的 在IIS7配置URL重写的时候,需要添加“脚本映射”,如果是64位系统,会有两个地方存放.net framework分别是32位系统和64位 ...

  8. ASP.NET导出EXCEL类

    最新ASP.NET导出EXCEL类 说明:可以导出ASP.NET页面和DATAGRID(WebControl)数据,可以导出表单头 using System;using System.Data;usi ...

  9. 扩展ASP.NET MVC HtmlHelper类

    在这篇帖子中我会使用一个示例演示扩展ASP.NET MVC HtmlHelper类,让它们可以在你的MVC视图中工作.这个示例中我会提供一个简单的方案生成Html表格. HtmlHelper类 Htm ...

随机推荐

  1. SQL插入字段

    //SQL插入字段 String dropTable="drop table if exists test;"; String columnGid ="alter tab ...

  2. CSS元素居中汇总

    总结实现不同类型元素居中的几种方法: 一.把margin值设置为auto(实现水平居中) 可以实现元素水平居中对齐 原理:使  margin-left=margin-right  如果设置  marg ...

  3. Es6 之 const关键字

    https://blog.csdn.net/jin_doudouer/article/details/80493649 es6中新增了一个const.就是用来定义一个常量的.以前其实一直没有把这个放在 ...

  4. Comet OJ - Contest #7 D 机器学习题 斜率优化 + 未调完

    Code: #include <cstdio> #include <algorithm> #include <cstring> #define setIO(s) f ...

  5. Leetcode 8. String to Integer (atoi)(模拟题,水)

    8. String to Integer (atoi) Medium Implement atoi which converts a string to an integer. The functio ...

  6. Histograms of Sparse Codes for Object Detection用于目标检测的稀疏码直方图

    AbstractObject detection has seen huge progress in recent years, much thanks to the heavily-engineer ...

  7. Conturbatio

    Conturbatio Time Limit: 6000/3000 MS (Java/Others)    Memory Limit: 65536/65536 K (Java/Others)Total ...

  8. 进阶1:Linux 环境准备_ 设置网络IP_安装火狐浏览器

    VM 已安装 centos6.5 Final 已安装 配置好了Linux  IP ,并能ping  通 ,例如 : ping www.baidu.com 设置LINUX 网络IP: https://j ...

  9. SpringMVC传参注解@RequestParam,@RequestBody,@ResponseBody,@ModelAttribute

    参考文档:https://blog.csdn.net/walkerjong/article/details/7946109 https://www.cnblogs.com/daimajun/p/715 ...

  10. canvas 方块旋转案例

    <!doctype html><html><head> <meta charset="UTF-8"> <meta name=& ...