参见 百度 http://jingyan.baidu.com/article/a3a3f8118b1c4d8da3eb8a60.html@{ ViewBag.Title = "Index"; Layout = "~/Views/Shared/_Layout.cshtml";}
分类:
其他好文 时间:
2015-07-30 16:40:26
阅读次数:
127
弹出框1.在Index.cshtml中添加创建按钮 创建2.控制器 [HttpGet] public ActionResult Create() { ViewBag.ModalID = Request["Modal...
分类:
其他好文 时间:
2015-07-30 10:50:06
阅读次数:
133
View中代码@{ ViewBag.Title = "dropdownlist";}dropdownlist@using (Html.BeginForm()){ test1 男 ...
分类:
Web程序 时间:
2015-07-29 11:45:47
阅读次数:
159
Mvc中:session:if (!string .IsNullOrEmpty(find)) //设置Session["oip"] = "无锡";ViewBag.oip =Session["oip"];if (Session["oip"] == null) //获取Session...
分类:
Web程序 时间:
2015-07-28 17:22:19
阅读次数:
112
在MVC中。如果想在代码中获得提交的表单中的数据。有两种方法:1、使用FormCollection2、使用Model接下来我们就具体介绍下:首先先介绍使用FormCollection来取得整个表单的信息前端页面:@{ ViewBag.Title = "GetFormInfo";}GetForm...
分类:
Web程序 时间:
2015-07-28 12:31:21
阅读次数:
217
这几天基本上都是交接的一些杂事,没有什么工作任务,就有空来回顾一下MVC。虽然工作中也用到了MVC,但已经被微软的架构师设计的找不到MVC的影子了,可能有别的考虑吧,至今还没研究出来。所以,今天就来回顾一下“原生”的MVC的基本操作,免得回来了以后跟你们聊不到一块~
这篇博客主要是MVC的数据传递中的ViewBag和ViewData。ViewData是一个字典集合,通过key值读取对应的valu...
分类:
Web程序 时间:
2015-07-27 21:09:16
阅读次数:
149
web.config连接字符串 _Layout.cshtml @ViewBag.Title @RenderSection("styles", required:false) @RenderSection("scripts", required:false) @RenderBody(...
分类:
Web程序 时间:
2015-07-22 17:56:04
阅读次数:
256
ViewData与ViewBag使用的是同一个数据源,因此数据一样,只是ViewBag 不再是字典的键值对结构,而是 dynamic 动态类型(http://www.cnblogs.com/kissdodog/archive/2013/01/20/2868644.html),它会在程序运行的时候动态...
分类:
其他好文 时间:
2015-07-12 11:06:16
阅读次数:
93
创建模板1.新建Header.ascx用户控件,此控件就是模板,修改内容如下:<%@ControlLanguage="C#"AutoEventWireup="true"CodeBehind="Header.ascx.cs"Inherits="WebMvc.App.Views.Default.Common.Public.Header"%>
<HEADERclass=header>
我是头模板,<%=ViewBag.messa..
分类:
其他好文 时间:
2015-07-08 22:53:48
阅读次数:
226