随笔分类 -  MVC

摘要:protected override void ConfigureApplicationContainer(TinyIoCContainer container) { List<Func<Assembly, bool>> IgnoredAssemblies = DefaultNancyBootstr 阅读全文
posted @ 2024-03-18 20:23 @索卡 阅读(25) 评论(0) 推荐(0)
摘要:@using(Html.BeginForm("actionName","controllerName",FormMethod.Post,new{data_ajax="false"})){ }主要是这一句:new{data_ajax="false"},当然也可以: 阅读全文
posted @ 2013-12-11 10:26 @索卡 阅读(829) 评论(0) 推荐(0)
摘要:MVC服务Autofac 控制反转容器 先下载 Autofac dll, web.config 配置iis6 <httpModules><addname="ContainerDisposal"type="Autofac.Integration.Web.ContainerDisposalModule,Autofac.Integration.Web"/></httpModules><modules><!--ii7配置ioc--><addname="ContainerDisposal& 阅读全文
posted @ 2012-06-04 16:31 @索卡 阅读(498) 评论(0) 推荐(0)
摘要: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 阅读全文
posted @ 2012-04-24 10:57 @索卡 阅读(262) 评论(0) 推荐(0)
摘要:ChildActionOnly:它的目的主要就是让这个Action不通过直接在地址栏输入地址来访问,而是需要通过RenderAction来调用它。[ChildActionOnly]publicActionResultGenreMenu(){returnView();}标记有 ChildActionOnlyAttribute 的任何方法只能通过 Action 或 RenderAction HTML 扩展方法调用。RenderAction:调用子操作方法并在父视图中以内联方式呈现结果 如: @{Html.RenderAction("GenreMenu", "Store 阅读全文
posted @ 2012-04-20 09:51 @索卡 阅读(209) 评论(0) 推荐(0)
摘要: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 阅读全文
posted @ 2012-03-27 14:46 @索卡 阅读(303) 评论(0) 推荐(0)