【鄒健】Asp.net MVC Fckeditor的擴充套件(支援PV3及自動繫結)
Asp.net MVC Fckeditor的擴充套件(支援PV3及自動繫結)
function StorePage(){d=document;t=d.selection?(d.selection.type!='None'?d.selection.createRange().text:''):(d.getSelection?d.getSelection():'');void(keyit=window.open('http://www.365key.com/storeit.aspx?t='+escape(d.title)+'&u='+escape(d.location.href)+'&c='+escape(t),'keyit','scrollbars=no,width=475,height=575,left=75,top=20,status=no,resizable=yes'));keyit.focus();}
Code highlighting produced by Actipro CodeHighlighter (freeware)
http://www.CodeHighlighter.com/
-->namespace System.Web.Mvc
{
using System;
///
/// 對Controller的Redirect操作的擴充套件
/// blog:http://chsword.cnblogs.com/
///
public static class RedirectExtension
{
///
/// 重定向到上一個Action. 即 header 的 "HTTP_REFERER" (
///
static public void RedirectToReferrer(this Controller controller) {
controller.Response.Redirect(controller.Request.ServerVariables["HTTP_REFERER"]);
}
[Obsolete("已經過時請使用RedirectToReferrer")]
static public void RedirectToReferer(this Controller controller)
{
RedirectToReferrer(controller);
}
///
/// Redirect 到站點根目錄 (
///
static public void RedirectToSiteRoot(this Controller controller) {
controller.Response.Redirect(controller.Request.ApplicationPath + "/");
}
}
}
Pv3中已經有了,不過void的情況下不支援,還是有其可用性的
<!--
Code highlighting produced by Actipro CodeHighlighter (freeware)
http://www.CodeHighlighter.com/
-->
namespace System.Web.Mvc
{
using System;
using System.Text;
using System.Web.Script.Serialization;
using System.Runtime.Serialization.Json;
///
/// 對RenderView的擴充套件
/// blog:http://chsword.cnblogs.com/
///
static public class RenderExtension
{
///
/// 顯示要顯示的文字
///
///
/// 文字內容
[Obsolete("僅在Asp.net Mvc Preview2中使用,PV3中已經提供新的方法Content")]
static public void RenderText(this Controller c, string str)
{
c.HttpContext.Response.Write(str);
}
///
/// 將要顯示的物件以JSON返回要客戶端
///
///
/// 要傳送的物件
[Obsolete("僅在Asp.net Mvc Preview2中使用,PV3中已經提供新的方法Json")]
public static void RenderJSON(this Controller c, object data)
{
c.RenderJSON(data, null);
}
///
/// 將要顯示的物件以JSON返回要客戶端
///
///
/// 要傳送的物件
/// 傳送的Content-Type預設為application/json
[Obsolete("僅在Asp.net Mvc Preview2中使用,PV3中已經提供新的方法Json")]
public static void RenderJSON(this Controller c, object data, string contenttype)
{
c.RenderJSON(data, contentType, null);
}
///
/// 將要顯示的物件以JSON返回要客戶端
///
///
/// 要傳送的物件
/// 傳送的Content-Type為空則預設為application/json
/// 編碼方式
[Obsolete("僅在Asp.net Mvc Preview2中使用,PV3中已經提供新的方法Json")]
public static void RenderJSON(this Controller c, object data, string contenttype, Encoding encoding)
{
HttpResponseBase response = c.HttpContext.Response;
if (!string.IsNullOrEmpty(contenttype))
{
response.ContentType = contenttype;
}
else
{
response.ContentType = "application/json";
}
if (encoding != null)
{
response.ContentEncoding = encoding;
}
if (data != null)
{
DataContractJsonSerializer sr = new DataContractJsonSerializer(typeof(object));
sr.WriteObject(response.OutputStream, data);
}
}
}
}
來自 “ ITPUB部落格 ” ,連結:http://blog.itpub.net/12639172/viewspace-332386/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- 【重典】Asp.net MVC Fckeditor的擴充套件(支援PV3及自動繫結)ASP.NETMVC套件
- 表空間自動擴充套件 AUTOALLOCATE 的擴充套件規律套件
- MAXDATAFILES,DB_FILES及控制檔案的自動擴充套件套件
- ASP.NET MVC 5 Web程式設計3 -- Controller的應用及擴充套件ASP.NETMVCWeb程式設計Controller套件
- ASP.NET Core擴充套件庫之Http通用擴充套件ASP.NET套件HTTP
- 自動化擴充套件挑戰:ROI套件
- ASP.NET MVC模型繫結——繫結部分欄位ASP.NETMVC模型
- Spring Cloud Gateway 擴充套件支援動態限流SpringCloudGateway套件
- 基於Dapper的開源Lambda擴充套件,且支援自動生成實體APP套件
- 【實驗】修改資料庫檔案為自動擴充套件以達到表空間自動擴充套件的目的資料庫套件
- 擴充套件spring cache 支援快取多租戶及其自動過期套件Spring快取
- 微服務架構:自動擴充套件簡介微服務架構套件
- 「擴充套件推薦」Laravel Auto Routes 自動路由套件Laravel路由
- jQueryautocomplete自擴充套件外掛、自動補全示例jQuery套件
- springboot中擴充套件ModelAndView實現asp.net core mvc的ActionResult效果Spring Boot套件ViewASP.NETMVC
- Java 動態代理機制分析及擴充套件Java套件
- 真香警告!擴充套件 swagger支援文件自動列舉所有列舉值套件Swagger
- SQL Server資料庫檔案不滿足擴充套件條件時不再自動擴充套件SQLServer資料庫套件
- kotlin 擴充套件(擴充套件函式和擴充套件屬性)Kotlin套件函式
- ASP.NET Core擴充套件庫之日誌ASP.NET套件
- ASP.NET 頁面aspx之擴充套件ASP.NET套件
- MAXLOGFILES應該以前的版本就能自動擴充套件套件
- 獲取表空間是否可自動擴充套件的SQL套件SQL
- ASP.Net MVC開發基礎學習筆記(2):HtmlHelper與擴充套件方法ASP.NETMVC筆記HTML套件
- iOS 推送通知及推送擴充套件iOS套件
- JavaScript 原生物件及擴充套件JavaScript物件套件
- 安裝PHP及Memcache擴充套件PHP套件
- Monitor的擴充套件支援string的超時鎖套件
- Hash分割槽表的使用及擴充套件套件
- 虛擬主機支援哪些擴充套件功能套件
- 不改表結構如何動態擴充套件欄位套件
- 「擴充套件包推薦」蘑菇丁 SDK—自動簽到套件
- 寫一個針對IQueryable<T>的擴充套件方法支援動態排序套件排序
- ASP.NET擴充套件庫之Http日誌ASP.NET套件HTTP
- 詳解ASP.NET頁面的aspx擴充套件ASP.NET套件
- gin自動引數繫結工具,rpc支援RPC
- 基於Dapper的開源Lambda擴充套件,且支援分庫分表自動生成實體APP套件
- WCF擴充套件:行為擴充套件Behavior Extension套件