随笔分类 -  MVC知识

摘要:在Asp.net MVC 3 web应用程序中,我们会用到ViewData与ViewBag,对比一下: ViewDataViewBag 它是Key/Value字典集合它是dynamic类型对像 从Asp.net MVC 1 就有了ASP.NET MVC3 才有 基于Asp.net 3.5 framework基于Asp.net 4.0与.net framework ViewData比ViewBag快ViewBag比ViewData慢 在ViewPage中查询数据时需要转换合适的类型在ViewPage中查询数据时不需要类型转换 ... 阅读全文
posted @ 2012-07-03 15:12 因为你 阅读(819) 评论(0) 推荐(0)
摘要:@RenderSection相当于在母版页占一个位置解决页面差异化的问题如JS何CSS的调用 1 <!DOCTYPE html> 2 <html> 3 <head> 4 <title>后台管理</title> 5 <link href="@Url.Content("~/Content/css.css")" rel="stylesheet" type="text/css" /> 6 <link href="@Url.Content 阅读全文
posted @ 2012-05-29 17:49 因为你 阅读(18471) 评论(1) 推荐(5)
摘要:Html页面1 <div class="nav">2 @Html.BuildNav(userInfo.UserID)3 <div class="clear">CSusing System;using System.Collections.Generic;using System.Globalization;using System.Linq;using System.Security.Principal;using System.Text;using System.Web.Mvc;namespace MFK.HTML{ publi 阅读全文
posted @ 2012-05-29 14:22 因为你 阅读(612) 评论(0) 推荐(0)