`
ladymaidu
  • 浏览: 681301 次
文章分类
社区版块
存档分类
最新评论

Controller in depth

 
阅读更多

1.The Controller Action

An action method normally returns an ActionResult and can take zero or many arguments.一个action方法通常情况下返回ActionResult,能够带0个或者多个参数。

If the view name matches the action name, there is no need to specify it when calling return View(). ViewData is a IDictionary<string, object> at its core. The type is System.Web.Mvc.ViewDataDictionary, but we really only need to worry about the interface.

Action methods can return any object type, including void. If the type derives from System.Web.Mvc.ActionResult, then that result will be executed. If any other type is returned, the framework will call the ToString() method on it and return a ContentResult.

2.Simple Controllers Do Not Need A View

这里实现一个用户登陆的功能:

UserInfo.cs

在view目录下新建一个目录User,然后再其中添加loginpage.aspx,其中loginpage.aspx :

UserController.cs

在其中:return RedirectToAction("Index", "Home");实现页面的跳转,也就是实现一个没有view的controller。

分享到:
评论

相关推荐

    ASP.Net MVC in Action

    The controller in depth 4. The view in depth 5. Routing 6. Customizing and extending the ASP.NET MVC Framework 7. Scaling the architecture for complex sites 8. Leveraging existing ASP.NET ...

    风电并网变流器谐波抑制机理分析及控制策略研究

    In order to improve adaptability for wind power gridconnected converter under non-ideal grid conditions and reduce the harmonic influence, harmonic suppression mechanism for grid-connected converter ...

    Software Defined Networks A Comprehensive Approach 2nd Edition Pdf

    Software Defined Networks: A Comprehensive Approach, Second Edition provides in-depth coverage of the technologies collectively known as Software Defined Networking (SDN). The book shows how to ...

    The Craft of Model-Based Testing

    It starts with an overview of MBT and follows with an in-depth treatment of nine different testing models with a chapter dedicated to each model. These chapters are tied together by a pair of ...

    PDController_forAUV.rar_Action!_PDController_forAUV_PID Vehicl

    In this Program, we design PID controller for Control of AUV depth. AUV is Automatic Underwater Vehicle that use in Underwater action and Control of its Depth is important.

    Pro Vue.js 2

    He then shows you how to use Vue.js in your projects, starting from the nuts and bolts and building up to the most advanced and sophisticated features, going in-depth to give you the knowledge you ...

    <<Patterns of Enterprise Application Architecture>>

    &lt;br&gt;The topics covered include: &lt;br&gt;Dividing an enterprise application into layers The major approaches to organizing business logic An in-depth treatment of mapping between objects ...

    Measurements and Mitigation of Peer-to-Peer-based Botnets - A Case Study on Storm Worm

    Furthermore, we present two different ways to disrupt the communication channel between controller and compromised machines in order to mitigate the botnet and evaluate the effectiveness of these ...

    Vega_STDP4028_DS.pdf

    The 60-bit LVTTL input ports on STDP4028 can be mapped to transfer video data either in two pixels per clock or single pixel per clock of a chosen color depth. The STDP4028 also supports both ...

    Pro AngularJS

    Starting from the nuts-and-bolts and building up to the most advanced and sophisticated features AngularJS is carefully unwrapped, going in-depth to give you the knowledge you need. Each topic is ...

    MAX9288-MAX9290.pdf

    The MAX9288/MAX9290 gigabit multimedia serial link (GMSL) deserializers receive data from a GMSL serializer over 50Ω coax or 100Ω shielded ...controller interrupt requests in display applications.

    Pro Vue.js 2(pdf英文原版-2018版)

    He then shows you how to use Vue.js in your projects, starting from the nuts and bolts and building up to the most advanced and sophisticated features, going in-depth to give you the knowledge you ...

    Spring.Boot.in.Action.2015.12.pdf

    ary 9Oish-character tweetable Boot application to an in-depth analysis of Boots Actuator in chapter 7, which enables a host of auto-magical operational features required for any production application...

    Apress.Pro.Vuejs.2

    He then shows you how to use Vue.js in your projects, starting from the nuts and bolts and building up to the most advanced and sophisticated features, going in-depth to give you the knowledge you ...

    Leap Motion Developer SDK -Windows

    The Leap Motion Developer SDK contains the necessary libraries to ... Make sure to check out our Links and Libraries section for support for other languages and frameworks and more in depth example code.

    professional asp.net mvc 3 PDF

    This in-depth book shows you step by step how to use MVC 3. Written by top ASP.NET MVC experts at Microsoft, the latest edition of this popular book covers new and updated features such as the new ...

    Professional ASP.NET MVC 3

    This in-depth book shows you step by step how to use MVC 3. Written by top ASP.NET MVC experts at Microsoft, the latest edition of this popular book covers new and updated features such as the new ...

    Professional ASP.NET MVC 4

    Microsoft insiders join giants of the software development community to offer this in-depth guide to ASP.NET MVC, an essential web development technology. Experienced .NET and ASP.NET developers will ...

Global site tag (gtag.js) - Google Analytics