随笔分类 - MVC
摘要:protected override void ConfigureApplicationContainer(TinyIoCContainer container) { List<Func<Assembly, bool>> IgnoredAssemblies = DefaultNancyBootstr
阅读全文
摘要:@using(Html.BeginForm("actionName","controllerName",FormMethod.Post,new{data_ajax="false"})){ }主要是这一句:new{data_ajax="false"},当然也可以:
阅读全文
摘要:MVC服务Autofac 控制反转容器 先下载 Autofac dll, web.config 配置iis6 <httpModules><addname="ContainerDisposal"type="Autofac.Integration.Web.ContainerDisposalModule,Autofac.Integration.Web"/></httpModules><modules><!--ii7配置ioc--><addname="ContainerDisposal&
阅读全文
摘要:MvcTagBuilder ToString()重载 ToString() <Lable id="test" style="color:blue">测试</Lable> ToString(TagBuilder.Normal) <Lable id="test" style="color:blue">测试</Lable> ToString(TagBuilder.StartTag) <Lable id="test" style="colo
阅读全文
摘要:ChildActionOnly:它的目的主要就是让这个Action不通过直接在地址栏输入地址来访问,而是需要通过RenderAction来调用它。[ChildActionOnly]publicActionResultGenreMenu(){returnView();}标记有 ChildActionOnlyAttribute 的任何方法只能通过 Action 或 RenderAction HTML 扩展方法调用。RenderAction:调用子操作方法并在父视图中以内联方式呈现结果 如: @{Html.RenderAction("GenreMenu", "Store
阅读全文
摘要:model:publicclassuser{[Remote("checkUserName","Home",ErrorMessage="已经存在此用户名")]publicstringUseName{get;set;}}controller:s[HttpGet]publicActionResultcheckUserName(stringuserName){boolisSafe=false;if(userName.Equals("0000"))isSafe=true; returnJson(isSafe,JsonRequ
阅读全文

浙公网安备 33010602011771号