2012-05-28 18:20 by 自由的生活, 1 visits, 网摘, 收藏, 编辑
摘要:对于 Web Service,我想大家都已经很熟悉了,笔者也是,几年前就搞过,在现在 WCF 的侵蚀下,Web Service 似乎已经被人们所忘记,这次因为项目所需要,重新拾起来,发现都快忘记了,比如在允许 Javascript 调用 Web Service,忘记取消注释 [System.Web.Script.Services.ScriptService] 了,导致调试了许久。好了,废话不多说了,开始示例了。1. 首先建一个 Web Service 项。由于说明都已经写在项目中了,故直接贴代码了。using System;using System.Collections.Generic;us
阅读全文
2012-05-23 22:39 by 自由的生活, 8 visits, 网摘, 收藏, 编辑
摘要:直接贴代码了:项目解决方案图资源文件图代码如下:<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"><html xmlns="http://www.w3.org/1999/xhtml"><head runat="server"> <title></title> <
阅读全文
2012-05-22 18:22 by 自由的生活, 9 visits, 网摘, 收藏, 编辑
摘要:直接贴代码了:using System;using System.Security.Cryptography;namespace DearBruce.ConAppTest{ class Program { static void Main(string[] args) { // 用 RSA 加密算法 API 来加密和解密 string word = "hello"; string encryptWord = RSAEncryption(word); Console.W...
阅读全文
2012-05-21 18:54 by 自由的生活, 6 visits, 网摘, 收藏, 编辑
摘要:当一个网站从 ASP.NET WebForm 转为 ASP.NET MVC 后,那些 URL 怎么办呢?比如,原来通过 ~/articles/may/zebra-danio-health-tips.html 能访问某一个页面,那现在转为 ASP.NET MVC 了怎么办呢?直接贴代码了:1. 新建一个类,继承 RouteBase 类。namespace DearBruce.LegacyUrlsRoute.MvcUI.Extensions{ using System; using System.Collections; using System.Collections.Gene...
阅读全文
2012-05-21 18:34 by 自由的生活, 9 visits, 网摘, 收藏, 编辑
摘要:ASP.NET MVC 扩展之 NoCacheAttribute 是为了让 Action 方法不缓存,直接贴代码了: public class NoCacheAttribute : FilterAttribute, IActionFilter { public void OnActionExecuted(ActionExecutedContext filterContext) { } public void OnActionExecuting(ActionExecutingContext filterC...
阅读全文
2012-05-08 18:37 by 自由的生活, 6 visits, 网摘, 收藏, 编辑
摘要:转载自:在ASP.NET MVC中通过URL路由实现对多语言的支持直接贴代码了! public class CultureAwareHttpModule : IHttpModule { private CultureInfo currentCulture; private CultureInfo currentUICulture; public void Dispose(){} public void Init(HttpApplication context) { context.Begin...
阅读全文
2012-05-03 19:02 by 自由的生活, 12 visits, 网摘, 收藏, 编辑
摘要:转载自:http://www.dozer.cc/2011/12/webform-take-example-by-mvc-ajax/MVC 的优雅用过 MVC 中局部更新的同学肯定会觉得其中的写法真的是非常的优雅:public ActionResult Index(){ var data = UserService.GetUserList(); if (Request.IsAjaxRequest()) { return PartialView("UserList", data); } else { return View(data)...
阅读全文
2012-05-02 18:48 by 自由的生活, 13 visits, 网摘, 收藏, 编辑
摘要:转载自:http://www.cnblogs.com/sobne/articles/1822479.html谢谢浏览!
阅读全文
2012-04-29 18:49 by 自由的生活, 31 visits, 网摘, 收藏, 编辑
摘要:我们的网站检测到用户使用的浏览器是 IE 6 后,就用下面的语句来提示 Ta:尊敬的用户,您好!新浪网检测到您的浏览器使用的是 IE 6 ,浏览器是电脑里的一款软件,就像您身边的一款手机。几年前,您的手机可能是最新款,可现在您的手机已经要被淘汰了。IE 8、IE 9 是目前比较新的浏览器,如果您使用的是 XP 系统,请您去这里下载最新的 IE 8(http://windows.microsoft.com/zh-CN/internet-explorer/downloads/ie-8),新浪网 2013 年将不支持 IE 6 来浏览,请您即使升级,以免影响您的体验,谢谢!谢谢浏览!
阅读全文
2012-04-28 18:14 by 自由的生活, 19 visits, 网摘, 收藏, 编辑
摘要:在学习 ASP.NET MVC 示例程序 Mvc3MusicStore 是,运行出现下面的错误:找不到请求的 .Net Framework Data Provider。可能没有安装。我们看一下 Web.Config 文件中的配置: <connectionStrings> <add name="MusicStoreEntities" connectionString="Data Source=|DataDirectory|MvcMusicStore.sdf" providerName="System.Data.SqlServer
阅读全文