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

推荐订阅源

奇客Solidot–传递最新科技情报
奇客Solidot–传递最新科技情报
WordPress大学
WordPress大学
N
Netflix TechBlog - Medium
T
Troy Hunt's Blog
Help Net Security
Help Net Security
L
LINUX DO - 最新话题
aimingoo的专栏
aimingoo的专栏
Microsoft Azure Blog
Microsoft Azure Blog
Y
Y Combinator Blog
Attack and Defense Labs
Attack and Defense Labs
M
MIT News - Artificial intelligence
Security Archives - TechRepublic
Security Archives - TechRepublic
SecWiki News
SecWiki News
博客园 - 三生石上(FineUI控件)
P
Privacy International News Feed
AI
AI
PCI Perspectives
PCI Perspectives
L
Lohrmann on Cybersecurity
G
Google Developers Blog
N
News | PayPal Newsroom
Hugging Face - Blog
Hugging Face - Blog
B
Blog RSS Feed
The Hacker News
The Hacker News
Apple Machine Learning Research
Apple Machine Learning Research
B
Blog
Hacker News - Newest:
Hacker News - Newest: "LLM"
I
InfoQ
Webroot Blog
Webroot Blog
www.infosecurity-magazine.com
www.infosecurity-magazine.com
V
Visual Studio Blog
酷 壳 – CoolShell
酷 壳 – CoolShell
U
Unit 42
A
About on SuperTechFans
Cyberwarzone
Cyberwarzone
Schneier on Security
Schneier on Security
Cisco Talos Blog
Cisco Talos Blog
D
Docker
博客园_首页
The Cloudflare Blog
S
Secure Thoughts
让小产品的独立变现更简单 - ezindie.com
让小产品的独立变现更简单 - ezindie.com
The Last Watchdog
The Last Watchdog
大猫的无限游戏
大猫的无限游戏
S
SegmentFault 最新的问题
Last Week in AI
Last Week in AI
F
Fortinet All Blogs
I
Intezer
Google DeepMind News
Google DeepMind News
Know Your Adversary
Know Your Adversary
Simon Willison's Weblog
Simon Willison's Weblog

博客园 - skylai

WCF学习之旅(一)---Hello World. WCF Client configuration Jquery表单验证 Jquery的一些常用信息 二进制、SOAP的序列化及反序列化 简单的Attribute实现. 泛型之泛型约束 C#泛型之泛型委托 C#2.0泛型介绍之简单泛型类。 序列化之XML序列化(一) Vs2005的win form动态生成菜单 强制字符换行CSS版和C#版 js操作xml 读写XML文件 js的一些杂谈 一个button同时执行多个有返回值的函数的解决方法(return false; or return true;) DataGrid里应用radio单选按钮 限制字符输入(ASCII 码) 前两天刚看书看到的,来这里跟大家分享一下有关C#处理指令的问题
mvc3 小技巧
skylai · 2012-02-04 · via 博客园 - skylai

1.在客户端的CS代码中增加HTML元素,对字符进行编码。

@Html.Raw(" ")

2.AJAX 链接

@Ajax.ActionLink("ajax link","index","home",new { a=3,b=3},new AjaxOptions{ UpdateTargetId="main"}) 

3.         /// <summary>

        /// 描述:输出PartialView HTML 字符串
        
/// </summary>
        
/// <param name="controller"></param>
        
/// <param name="partialViewName">部分视图文件名</param>
        
/// <returns></returns>
        protected static string RenderPartialViewToString(Controller controller, string partialViewName)
        {
            IView view = ViewEngines.Engines.FindPartialView(controller.ControllerContext, partialViewName).View;
            using (StringWriter writer = new StringWriter())
            {
                ViewContext viewContext = new ViewContext(controller.ControllerContext, view, controller.ViewData, controller.TempData, writer);
                viewContext.View.Render(viewContext, writer);
                return writer.ToString();
            }
        }

        /// <summary>
        
/// 描述:输出View HTML 字符串
        
/// </summary>
        
/// <param name="controller"></param>
        
/// <param name="viewName">视图文件名</param>
        
/// <param name="masterName">母板页文件名</param>
        
/// <returns></returns>
        protected static string RenderViewToString(Controller controller, string viewName, string masterName)
        {
            IView view = ViewEngines.Engines.FindView(controller.ControllerContext, viewName, masterName).View;
            using (StringWriter writer = new StringWriter())
            {
                ViewContext viewContext = new ViewContext(controller.ControllerContext, view, controller.ViewData, controller.TempData, writer);
                viewContext.View.Render(viewContext, writer);
                return writer.ToString();
            }
        }

4.a标签有javascript:void(0);的效果,在onclick后加return false.就可以。

<a onclick="updateStatus('11156','0');return false;" href="/Res_Item/Index.aspx" class="button">待发布</a>