惯性聚合 高效追踪和阅读你感兴趣的博客、新闻、科技资讯
阅读原文 在惯性聚合中打开

推荐订阅源

PCI Perspectives
PCI Perspectives
AI
AI
L
LINUX DO - 最新话题
Exploit-DB.com RSS Feed
Exploit-DB.com RSS Feed
W
WeLiveSecurity
T
Troy Hunt's Blog
K
KPMG report finds enterprise disconnect between AI and its ROI | CIO
Forbes - Security
Forbes - Security
Google DeepMind News
Google DeepMind News
Hacker News - Newest:
Hacker News - Newest: "LLM"
O
OpenAI News
D
DataBreaches.Net
S
Secure Thoughts
SecWiki News
SecWiki News
L
LangChain Blog
Google DeepMind News
Google DeepMind News
博客园 - 【当耐特】
Recent Announcements
Recent Announcements
Martin Fowler
Martin Fowler
cs.AI updates on arXiv.org
cs.AI updates on arXiv.org
Application and Cybersecurity Blog
Application and Cybersecurity Blog
Engineering at Meta
Engineering at Meta
H
Heimdal Security Blog
有赞技术团队
有赞技术团队
The Last Watchdog
The Last Watchdog
Recent Commits to openclaw:main
Recent Commits to openclaw:main
宝玉的分享
宝玉的分享
N
News | PayPal Newsroom
博客园 - 聂微东
TaoSecurity Blog
TaoSecurity Blog
Cloudbric
Cloudbric
Blog — PlanetScale
Blog — PlanetScale
cs.CV updates on arXiv.org
cs.CV updates on arXiv.org
量子位
T
Threatpost
Security Latest
Security Latest
P
Privacy & Cybersecurity Law Blog
GbyAI
GbyAI
博客园 - 叶小钗
L
Lohrmann on Cybersecurity
S
Security @ Cisco Blogs
Y
Y Combinator Blog
Cyber Security Advisories - MS-ISAC
Cyber Security Advisories - MS-ISAC
T
Tailwind CSS Blog
C
Cyber Attacks, Cyber Crime and Cyber Security
酷 壳 – CoolShell
酷 壳 – CoolShell
H
Hackread – Cybersecurity News, Data Breaches, AI and More
Apple Machine Learning Research
Apple Machine Learning Research
N
Netflix TechBlog - Medium
L
LINUX DO - 热门话题

博客园 - Adam.Zhao

简单示例理解神闭包 ejs 模板使用方法 我使用的开源组件汇总,以备学习使用 了不起的Node.js--之五 TCP连接 Windows7下Java运行时环境搭建 了不起的Node.js--之四 了不起的Node.js--之三 了不起的Node.js--之二 了不起的Node.js--之一 请大家有需要购物的到我的网站上吧。 AngularJS应用骨架 最近在研究google的angularjs 好久没有来写博客了 c#二进制文件数据转换base64字符串文本代码 学习content-type 网站性能优化之服务端(一) 艺龙旅行网招聘了 关于项目管理的几点建议 HP CQ35 Windows7声卡驱动安装不上问题
ActionFilterAttribute做切面编程的Url的格式化例子
Adam.Zhao · 2012-02-11 · via 博客园 - Adam.Zhao
/// <summary>
/// 格式化Url过滤器
/// </summary>
public class UrlFormatFilter : System.Web.Mvc.ActionFilterAttribute
{
/// <summary>
/// 在Action执行前执行
/// </summary>
/// <param name="filterContext"></param>
public override void OnActionExecuting(System.Web.Mvc.ActionExecutingContext filterContext)
{
string url = filterContext.HttpContext.Request.Url.OriginalString;
if (System.Text.RegularExpressions.Regex.IsMatch(url, "[A-Z]"))
{
url = url.ToLower();
filterContext.HttpContext.Response.StatusCode = 301;
filterContext.HttpContext.Response.Redirect(url, true); 
}
}
}

/// <summary>
/// SEO始发城市Action
/// </summary>
/// <param name="code"></param>
/// <returns></returns>
[UrlFormatFilter]
[NoCacheFilter]
public ActionResult TejiaCity(string city)
{
city = city ?? string.Empty;
IBaseInfoSearch baseInfoService = ServiceFactory.BaseInfoSearch();
AirCityInfo cityInfo = baseInfoService.GetAirCityByName(city);
CityLowPriceViewModelBuilder builder = new CityLowPriceViewModelBuilder(cityInfo);
CityLowPriceViewModel model = builder.Build(this.ControllerContext);

// 初始化页面头
InitTejiaCityPageInfo(cityInfo);
InitlizeRegisterResource();
return View("TejiaCity", model);
}