MVC成长记_MVC基础

本文详细介绍了 ASP.NET MVC 的工作原理,包括路由映射、控制器如何与视图交互、模型绑定等内容,并探讨了如何在应用中创建和管理数据。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

@model String

  • lowcase define the type of data coming into the view.
  • model give us access to data passed into our view from a controller.
  • uppercase accesses the model data passed into the view.
  • controller send data to view.

controller

  • namespace
  • class
  • method return IactionResult are called action method provided responses usable by browser.

Routing

  • How do Routes Map Up with Controllers?
    • By default,the first section of the route maps up to the controller of the same name,and the second section maps up to an action within that cotroller of the same name.
    • When we dont have the route part of url, asp.net mvc will use a default route.

Model

  • Create a class including members and some functions.

Getting user Input

  • steps to the solution that user use input.
    • Create from in a view.
    • Add Create() method to controller.
    • Move existing logic out of the Index() into Create()

Retaining Data

  • We should use either an array or list to handle our group of characters.
  • Adding new object to an array.
  • Adding a new object to a list.
  • List let us more than one obj
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包

打赏作者

Yao.Li

爱的魔力,一被卡布奇诺~

¥1 ¥2 ¥4 ¥6 ¥10 ¥20
扫码支付:¥1
获取中
扫码支付

您的余额不足,请更换扫码支付或充值

打赏作者

实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值