在MVC的Web应用程序中,我们经常会出现这样的操作,从一个视图跳转到另外一个视图,大部分情况下都是通过链接来实现,当然这是一种非常不错的选择,为什么不说这是最好的选择呢?因为它也有其弊端,我们看看如下:

<a href="/Home/Index">这是一个链接</a>

当我们点击这个链接时,Home则对应的是控制器,Index则对应的是Action方法,并发出此请求进行跳转,貌似没有半点错误,但是,但是,如果我某一天想改变这个URL链接呢?要是我想删除Home控制器决定创建一个新的控制器呢,那又该怎么办呢?那这个写死的链接不就失效了吗,也就是说无法正常进行跳转了!不用着急,在MVC中提供一种更加好的方式来解决这个问题,通过路由来实现并解决这个问题最终动态生成URL

在MVC中跳转视图生成链接的方式我们都知道是用 @Html.ActionLink 来进行,利用它的第四个重载方法,如:

@Html.ActionLink("这是一个跳转到Action链接","Index","Home")

第一个参数为链接文本,第二个为控制器上对应的方法Index,最后一个则是控制器Home,最终渲染成html则是:

<a href="/Home/About">这是一个跳转到Action链接</a>

到了这里你觉得是不是@Html.ActionLink的作用也就是如此了,是不是觉得这个来自HtmlHelper的扩展方法也不过如此呢?

@Html.ActionLink探讨(一)

我们创建项目并创建如下一个Test控制器,并在该控制器上定义如下两个方法:

 public class TestController : Controller
{
public ActionResult Index()
{
ViewBag.Controller = "Test";
ViewBag.Action = "Index";
return View("DisplayActionView");
} public ActionResult MyBlog(string id = "MyBlogId")
{
ViewBag.Controller = "Test";
ViewBag.Action = "MyBlog";
ViewBag.CustomVariable = id;
return View();
}
}

看了上述定义的Index方法返回的视图是DisplayActionView视图,那我们是不是应该在该控制器下做出如下定义呢:

 public ActionResult DisplayActionView()
{
return View();
}

然后在该视图中显示一下我们已经跳转到该视图了呢,如下:

     <div>
<h1>DisplayActionView</h1>
</div>

结果如下:

aaarticlea/png;base64,iVBORw0KGgoAAAANSUhEUgAAAOAAAAAjCAIAAAACM5GsAAAPA0lEQVR4nO2baVwTRx+A/4iCHCoIEpBLeZVLFAVFKQLeCiKIWA+Oigf1QIvHi2iVKqWKWE+seIDkRaVYtFLrQRW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r21m98jSXhEd4DTGwf3aXxUcAeIyKNeObJo+Z3Nhk+RJrDwtEgDWnMgSIJR6OHAIGN4okzdU9z0gjbHHyp0//1XR4/0ALdzpvZwwWH3477iR4cg3LtEX43Z5O6koA2jo2i/4KuUpWdKlWVQvF2stglFKYsx0M10A7S/mB11/USlVSV7s+3UAjJ3iWtzVaEJe+81jm8eNAgAgWLjuOpeOOM+XWmiDsf2hJJL0vW8IszWIvl2MT6q8ubu72Kiu9UlEgE134qLDT7suvO3JpQPT9LUBhphZOIfG3W+VPTi1ng5yUlEGgt3iMw9K8SewxG09LmVoyMlc6T9npBxaP0Z1sKqmzjy/g4+KaN0n0qNmdf/ZcN8bLMRI9pIU5B5Plmqb4ntTxhJkbXoIXsUH9byl82OkwxBysdQoJysCAGhMmL0v9u57X5TwK9MA4GhGLUKIdC1Ci7C7TObN6B8+1fegLKqXi7WmnklmjfyPfz4eAbe5vo7G7Kj/I+I/4+dn1/bjp3QKPg2fSFAho3qJ45ihOoZppX+3wfgRVGfGTjDUNBtvbmdIWHfpFf+zfIuloE/5JIKyis+ESIjIlLcb8tH1NJLPHd0TujecmJb32b4xUtCnDLz/8qFAAQ6FoAoGNApBFQxoFIIqGNAoBFUwoFEIqmBAoxBUwYBGIaiCAc3/Adx/4iDiAsiCAAAAAElFTkSuQmCC" alt="" />

我们确实要创建DisplayActionView视图只是我们不创建该Action方法,我们直接在Views文件夹下的Shared文件夹下定义该视图。如下:

<body>
<h1>Controller Invoked: @ViewBag.Controller</h1> <h1>Action Invoked: @ViewBag.Action</h1> <h3>
@Html.ActionLink("this is generate url dynamic", "MyBlog")
</h3>
</body>

当然在上述Test控制器里还有个MyBlog方法未定义视图,我们定义视图内容如下:

<body>
<h3>Controller processed the URL: @ViewBag.Controller</h3>
<h3>Controller action invoked: @ViewBag.Action</h3>
<h3>The custom variable is: @ViewBag.CustomVariable</h3>
</body>

最后我们进行下路由配置:

 routes.MapRoute("CustomRoute", "{controller}/{action}/{id}",
new
{
controller = "Test",
action = "Index",
id = UrlParameter.Optional
});

下面我们运行下程序看看其结果,通过运行Test下的Index方法然后直接跳转到DisplayActionView,如下:

aaarticlea/png;base64,iVBORw0KGgoAAAANSUhEUgAAASoAAABtCAIAAACZcrsYAAAgAElEQVR4nO2deVwTx9+AxxYtFaVSrFZaRaWgVCp4oEEwWxGrFcEDL6iKR9FSrFjEo1JLPVFA8UI8QLzQIAUEwYNDRAREgWi4bwhBwpGQEAgk7GbePxJycCggNfb3zvPhH5LN7MzsPLNzJPsFEIFAKAmg7AwgEP9/QfohEEoD6YdAKA2kHwKhNJB+CITSQPohEEoD6YdAKA2kHwKhNJB+CITSQPohEEoD6YdAKA2kHwKhNP6f6ici2ji15ekZLxpa2ro+gsCb2K8zk5OYTe83Zx8QRAMjn1Ze269J4uzq8oraxv5M879ML/UTcuODDq+znI9h89Ztco96/OCvE1Hcfydn/xJMargthpHJplO+HTt0wpSEik7ZL4vFMAwjm02frPfZIJWgHCVksizWGeuErYPze+sLShMDrDGyoe4o7K/Q/koz3AvDyGaGE8f9dulJPyXJv/lH53rCMAyz3fwnk99PJ/k36YV+7KKk1dO0vp3vmMviE4KmVIrH1FGDAbDOEPR3ppqYT9MymgREf6crh7D+hOl3YFxX+rUT4WENAFCKfu1wPawBAOBwEuv9n5uffgYAYLqv3/SDkMgNsAMAOPgm9E96/OeWAwaZO15gCVvi3UgAfLE/NBvnMy9sMlPXM06vau6fs7TT0sBIzSwV9muaPdZPWLR96qiPtSwfMppEkpcI2j2P0UPV/F72cz/DTz+jqW+SVdPvWsvDDcKmvFm/BF8HZesHfR2A0vKQE9Tf+kFWvFs/6sdN8xqhbfS4hAOhIN7NBADNfaFZEEJhbYz513rXqK/75SxSiu55f2W6r387wp7pJ2p7ftYOgIELjtyVf5ng0beYG68PLhB198E+QLTG/D0P6ScG6fcGyh6f2fVHEAeHHfSDEMZcdP7nJaNfztKOIGyvuYpS9CMay5fPHAvUdS+/6FAkvK60tJLV1H/6CQvizk/9cjDSTwzSr2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u43+D4O+84lAKA2kHwKhNJB+CITSQPohEEoD6YdAKA2kHwKhNJB+CITSQPohEErj/wBovklRFxyYxQAAAABJRU5ErkJggg==" alt="" />

 @Html.ActionLink("this is generate url dynamic", "MyBlog")

我们用到HtmlHelper的扩展方法ActionLink,上述我们是重载了第一个方法,第一个参数是链接文本,而第二个则是Action名称,但是我们并未给出其控制器名称即控制器未知。我们把鼠标放在该链接上看看,如下:

aaarticlea/png;base64,iVBORw0KGgoAAAANSUhEUgAAAcEAAAAXCAIAAAD8yWM5AAARfklEQVR4nO2c61Nbd3rH+Qv2TfuqM+20nXa742ni7Uxn6+522kl2kuxuvLtp4jixSew4MdhxvLE3vnAHG8xV2IDFHaQjHZ2rxE0IhJAEAiTQBd11dBdC6C5xkTHobnv74iQkTYvXztrrJD7f+bw4z3Oe2+/h8HvFUPAHSt9Z3RsYyB869DknTjyIRp/1RJQoPXcqeNYDUPrmuk8QuVdfzR86lDt06J5I9KzHoUTpeRR1h36H9SCRyFdU5A8dyhUXP0inn/U4lCg9j6Lu0O+wHty/f294OHf48AOv91nPQonSc6oCpT1G8d1FKzOYB/BnPgYFxXNLwerWH544en96dev+06hMQUFB8a2iwLv54ImjX0t7N+8/jcoUFBQU3yoKVjYfPAqejfuejfuPGKxbS3k3vwx2r9/rE5lExtAjpj8irvV7lexZIpx53ET3+r2uCb3Wd3fJvdU9qbc+foXnClc8X8GesUWoLVFQ/D8UrGzc349Zc6SNq7AEU0Qo1QTPtfEWraHMQ+L30PqS3s0vTVc8f/rWyMC06VFy98MVy98WaFmzVs/6PUc01zK0NCg2Hyyi6Xx3H7eUM55/rwmT2WITWv+JZlzv2/lTBrsGzR841XTgVNPLl3u1q3dXNu5rVraP1EJMKbGycV9sCr9ytZ8MOHCq6XzXxMrGffas9cfFrS+cbhHqA8veu6doQ3sBR2/AS66tlY379ki2Fp4/2cLde3XgVNOHN4cedzzOnP0GKq9gSQ8W0WTW2J6fr/G9WjowrvV//YdOxH5dCRw41fTPHzaXMC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3TJzL9KUVMgWQle6YalD1ifPek4XK/SLt693EbqT13auF57epdvW/nJ5+0X4fnzY/weVBQfJ8oMAWST5w5Iu6K5R4rxbiWrACkN1D505iH4iEUt42+8FGLQOv/BrnGtd1GXPGXb5T94PUrVwbEz/wsFBR/fgqM/uQTR2aJOWO5p1GZgoKC4ltFgXFt94kza4k6Y9mnUZmCgoLiW0UBbwh74mA4MjyMf/EMd9Db/zw8jbN8l+BhPN7/8nB5T6fRk4DL+zq8P++0/3cALg/l8lAcR1AMwnAY5yI4F+FyUZyL4BiEYzCKQggCYTiCc1EMRyEIZLMBDgeAYRBFOQgCckCAAwIAc4DJ6AeYgxDExnGEBIZBHEe4XBTHEbIyCYpBGAZjKIRhMJeLYhiEohCCgBwOC0U4MMSGIDbZGoZBHENwLophMIrBKApxIDaKIQgKwwiE4SiCQigKYSiEwCCOwRgGcXEYxyAMg1CEg2EQhkEI+YBCXC6KIhAXR3EMIQfjcjEeD8dxBEUhFIW5XBTFYBSFsS+aIiiE4+R+YASFIBhEURhDYQyDERjEUAhFOAgMwhCIwiCCgDDMRmAQRb7wwyACcxAEhCEWAoMoyoY4TBhmoQgbggAQZCAIG0HYEAQgCPj52TksBOYgCAfisGCIrMZBYBCFQQQGyZowxCZNGAJhGMRQ6ItEEEchFAZhiAVzABQGYQ6LzRxEYRBDORAHQCAWArNxhAODAMhioBAb4bBAYBDlsFCIDTIHOSxGQ31dZUV5eXlZdXVlTU11VVVldXVVdXVldVVlVWV5VVVlzbVq6v/YU6JEidI3F3WHUqJEidI31/8AMub/ejUI5hcAAAAASUVORK5CYII=" alt="" />

@Html.ActionLink 的作用了,我们回归起初的话题我们利用 <a href="/Home/Index">这是一个链接</a> 将控制器写死,当我们删除该控制器那后果可想而知,当我们通过上述利用@Html.ActionLink来实现时则是通过控制器来动态生成该链接,即使我们删除控制器创建一个新的控制器该链接会动态的重新生成,这才是在MVC中要给出@Html.ActionLink的最后渲染成a标签的真正作用所在

ASP.NET MVC之视图生成URL的更多相关文章

  1. ASP.NET MVC之视图生成URL(二)

    前言 上一节我们讲述了MVC中从控制器到视图传递数据的四种方式,想必大家早已掌握了,那我们继续往下走. 话题 在MVC的Web应用程序中,我们经常会出现这样的操作,从一个视图跳转到另外一个视图,大部分 ...

  2. Asp.net MVC Razor视图模版动态渲染PDF,Razor模版生成静态Html

    Asp.net MVC Razor视图模版动态渲染PDF,Razor模版生成静态Html 1.前言 上一篇文章我开源了轮子,Asp.net Core 3.1 Razor视图模版动态渲染PDF,然后,很 ...

  3. ASP.NET MVC 5 - 视图

    在本节中,你要去修改HelloWorldController类,使用视图模板文件,在干净利索地封装的过程中:客户端浏览器生成HTML. 您将创建一个视图模板文件,其中使用了ASP.NET MVC 3所 ...

  4. ASP.NET MVC的运行机制--url的全局分析

    全局 首先我们来看一副图片       首先,用户通过Web浏览器向服务器发送一条url请求,这里请求的url不再是xxx.aspx格式,而是http://HostName/ControllerNam ...

  5. [转]ASP.NET MVC 5 - 视图

    在本节中,你要去修改HelloWorldController类,使用视图模板文件,在干净利索地封装的过程中:客户端浏览器生成HTML. 您将创建一个视图模板文件,其中使用了ASP.NET MVC 3所 ...

  6. ASP.NET MVC 学习之路由(URL Routing)

    在ASP.NET MVC中,一个URL请求是由对应的一个Controller中的Action来处理的,由URL Routing来告诉MVC如何定位到正确的Controller和Action. 默认路由 ...

  7. asp.net mvc 部分视图加载区别

    ASP.NET MVC 部分视图   ASP.NET(11)  版权声明:本文为博主原创文章,未经博主允许不得转载. [部分视图] ASP.NET MVC 里的部分视图,相当于 Web Form 里的 ...

  8. 在ASP.NET MVC中实现基于URL的权限控制

    本示例演示了在ASP.NET MVC中进行基于URL的权限控制,由于是基于URL进行控制的,所以只能精确到页.这种权限控制的优点是可以在已有的项目上改动极少的代码来增加权限控制功能,和项目本身的耦合度 ...

  9. ASP.NET MVC 解析模板生成静态页一(RazorEngine)

    简述 Razor是ASP.NET MVC 3中新加入的技术,以作为ASPX引擎的一个新的替代项.在早期的MVC版本中默认使用的是ASPX模板引擎,Razor在语法上的确不错,用起来非常方便,简洁的语法 ...

随机推荐

  1. Qt之模拟时钟

    简述 Qt自带的示例中有一个是关于时钟,演示了如何用QPainter的转换和缩放特性来绘制自定义部件. 其中主要包含了时针.分针的绘制,并不包含秒针.下面,我们在原示例的基础上进行扩展. 简述 实现方 ...

  2. Git删除远程分支

    查看 git branch -a 删除远程分支 git branch -r -d origin/branch-name  //只是删除的本地对该远程分支的track git push origin : ...

  3. abap注意

    1.建表的时候所有的数据元素的总长度不能超过1024. 2.表的主键修改在se11激活不成功,但是可以在se11保存,然后到se14中激活. 3.SM12解锁,在很多时候,经常出现某个表或者可修改的地 ...

  4. Java多线程-新特征-锁(上)

    在Java5中,专门提供了锁对象,利用锁可以方便的实现资源的封锁,用来控制对竞争资源并发访问的控制,这些内容主要集中在java.util.concurrent.locks 包下面,里面有三个重要的接口 ...

  5. JS模块式开发

    问题:js文件须严格保证加载顺序(比如上例的1.js要在2.js的前面),依赖性最大的模块一定要放到最后加载,当依赖关系很复杂的时候,代码的编写和维护都会变得困难! C语言中模块开发-include ...

  6. (置顶)js实现超过页面一屏后,点击图标滚动到页面顶部top

    <script type="text/javascript">$(document).ready(function() {    var ScrolltoTop = $ ...

  7. IKAnalyzer 和 solr4.3 冲突

    solr4.3 运行之后发现异常:Exception in thread "main" java.lang.VerifyError: class org.wltea.analyze ...

  8. HDU 3076 ssworld VS DDD 概率dp,无穷级数,oj错误题目 难度:2

    http://acm.hdu.edu.cn/showproblem.php?pid=3076 不可思议的题目,总之血量越少胜率越高,所以读取时把两人的血量交换一下 明显每一轮的胜率和负率都是固定的,所 ...

  9. NOIP 2003解题报告

    第一题(神经网络): 题目大意,给出一些点,每个点都有2个值,c和u,给出一些有向边,权值为w.入度为0的点的c已知,其它点的c未知,每个入度不为0的点node的c等于sum(c[k]*w[k][no ...

  10. MySql插入记录时判断

    我们在开发数据库相关的逻辑过程中, 经常检查表中是否已经存在这样的一条记录, 如果存在则更新或者不做操作, 如果没有存在记录,则需要插入一条新的记录. 这样的逻辑固然可以通过两条sql语句完成. SE ...