随笔分类 -  Asp.net mvc技术

Asp.net mvc技术
摘要:需求:有些网站需要多语言显示,比如简体中文,繁体中文,英文。 1、创建一个mvc项目: 2、创建App_GlobalResources 创建了中文、英文两个语言的资源文件,中文是程序的默认语言,所以我先创建Global.resx文件,然后是Global.en.resx,中间的“en”是英语的Cult 阅读全文
posted @ 2017-04-06 17:15 大空白纸 阅读(6001) 评论(4) 推荐(0) 编辑
摘要:RouteConfig.cs 代码如下: Controller自定义路由标签: 阅读全文
posted @ 2016-11-03 10:12 大空白纸 阅读(1360) 评论(0) 推荐(1) 编辑
摘要:错误如下图: 1:Area下的XXXAreaRegistration 添加:new string[] { "xxx.Areas.xxx.Controllers" } 2:RouteConfig 下添加 namespaces: new string[] { "xxx.Controllers" } 具体 阅读全文
posted @ 2016-11-01 14:53 大空白纸 阅读(925) 评论(0) 推荐(0) 编辑
摘要:你的dll文件是在64位机下编译的,而你的服务器是32位机,所以无法调用或者你的dll文件是在64位开发环境下下编译的,而你现在的调用程序是的32位,所以无法调用1.对IIS设置32位环境运行 阅读全文
posted @ 2015-12-11 12:16 大空白纸 阅读(805) 评论(0) 推荐(0) 编辑
摘要:@{ ViewBag.Title = "多文件上传测试";}多文件上传测试 using System;using System.Collections.Generic;using System.IO;using System.Linq;using System.W... 阅读全文
posted @ 2015-09-18 15:59 大空白纸 阅读(478) 评论(0) 推荐(0) 编辑
摘要:一、使用MVC中的Filter来对Session进行验证(1)方法1:public class MyAuthorizeAttribute : FilterAttribute, IAuthorizationFilter{ public void OnAuthorization(Authori... 阅读全文
posted @ 2015-06-19 10:40 大空白纸 阅读(336) 评论(0) 推荐(0) 编辑
摘要:最近在ASP.NET MVC项目中碰到这样的情况:在一个controller中设置了Session,但在另一个controller的构造函数中无法获取该Session,会报"System.NullReferenceException"错误。之所以这样做是因为希望在controller构造函数中获取S... 阅读全文
posted @ 2015-06-19 10:36 大空白纸 阅读(2464) 评论(2) 推荐(1) 编辑
摘要:using System;using System.Collections.Generic;using System.Linq;using System.Web;using System.Web.Mvc;namespace OAMvcApp.Models{ public class Login... 阅读全文
posted @ 2014-10-31 16:39 大空白纸 阅读(149) 评论(0) 推荐(0) 编辑
摘要:using System;using System.Collections.Generic;using System.Linq;using System.Text;using System.Threading.Tasks;namespace ConsoleAppEF{ class Progra... 阅读全文
posted @ 2014-10-30 20:59 大空白纸 阅读(239) 评论(0) 推荐(0) 编辑
摘要:using System;using System.Collections.Generic;using System.Linq;using System.Web;using System.Web.Mvc;namespace WebApplication1.MyHtmlHelper{ publi... 阅读全文
posted @ 2014-08-18 17:17 大空白纸 阅读(179) 评论(0) 推荐(0) 编辑
摘要:@{ ViewBag.Title = "Index";}@{ int pageIndex = (int)ViewBag.CurrentPage; int pageCount = (int)ViewBag.Pages;}Index cateId ... 阅读全文
posted @ 2014-08-18 17:08 大空白纸 阅读(285) 评论(0) 推荐(0) 编辑