摘要: form搜索View中<form action="/Home/Search" method="get"><input type="text" name="q" /><input type="submit" value="Search" /></form>控制器public ActionResult Search(string q){var albums = storeDB.Albums.Include("Artist& 阅读全文
posted @ 2013-03-14 20:08 真诚待 阅读(662) 评论(0) 推荐(0) 编辑
摘要: 通过系统自带的Authorize限制匿名访问通过在web.config,设置为form验证, 并拒绝所有的匿名用户<authentication mode="Forms"> <forms loginUrl="~/Account/Login" timeout="2880" /> </authentication>如果我们开放首页比如说Home/Index,那么做如下配置. 如果是Home文件夹下所有的页面都能访问, 那么 path=”Home”即可<location path="Hom 阅读全文
posted @ 2013-03-14 17:15 真诚待 阅读(228) 评论(0) 推荐(0) 编辑