MVC传递Model
@using System.Configuration;
@using System.Text.RegularExpressions;
@model Model.NewInfo? // 指定Module的類型
@{
?
??? if (Model == null) { return; }
??? var ltChannel = BLL.BLLChannel.Get_Channel_List();
}
?
@section head{
??? <title>采集>> @Model.New_Title.Trim()</title> 調用Model的內容
}
?
??????? public ActionResult NewInfo(int id)
??????? {
??????????? Model.NewInfo newInfo = BLL.BLLNewInfo.Get_NewInfo(id);
??????????? return View(newInfo);//傳遞newInfo,作為page頁的Model
??????? }
?
1.頁面get方法傳值;
2.接收端直接寫對應的參數;
3.特殊參數:action會得到路由配置中的action地址;即action是關鍵字;
4.參數不安全時使用【validate=false】
轉載于:https://www.cnblogs.com/thaughtZhao/p/4884495.html
總結
以上是生活随笔為你收集整理的MVC传递Model的全部內容,希望文章能夠幫你解決所遇到的問題。
- 上一篇: HDOJ(HDU) 1994 利息计算(
- 下一篇: 性能测试脚本之SQLServer执行语句