【鄒健】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/,如需轉載,請註明出處,否則將追究法律責任。
相關文章
- springboot中擴充套件ModelAndView實現asp.net core mvc的ActionResult效果Spring Boot套件ViewASP.NETMVC
- ASP.NET Core擴充套件庫之Http通用擴充套件ASP.NET套件HTTP
- Spring Cloud Gateway 擴充套件支援動態限流SpringCloudGateway套件
- 自動化擴充套件挑戰:ROI套件
- 基於Dapper的開源Lambda擴充套件,且支援自動生成實體APP套件
- 擴充套件spring cache 支援快取多租戶及其自動過期套件Spring快取
- 真香警告!擴充套件 swagger支援文件自動列舉所有列舉值套件Swagger
- ASP.NET Core擴充套件庫之日誌ASP.NET套件
- 微服務架構:自動擴充套件簡介微服務架構套件
- springboot擴充套件配置檔案自動載入Spring Boot套件
- 「擴充套件推薦」Laravel Auto Routes 自動路由套件Laravel路由
- Monitor的擴充套件支援string的超時鎖套件
- kotlin 擴充套件(擴充套件函式和擴充套件屬性)Kotlin套件函式
- 實現自動切換主題的 VSCode 擴充套件VSCode套件
- gin自動引數繫結工具,rpc支援RPC
- ASP.NET擴充套件庫之Http日誌ASP.NET套件HTTP
- 擴充套件Spring Cloud Feign 實現自動降級套件SpringCloud
- Analytics Zoo Cluster Serving自動擴充套件分散式推理套件分散式
- 透過擴充套件讓ASP.NET Web API支援W3C的CORS規範套件ASP.NETWebAPICORS
- 擴充套件、接管MVC都不會,還會用Spring Boot?套件MVCSpring Boot
- iOS 推送通知及推送擴充套件iOS套件
- 基於Dapper的開源Lambda擴充套件,且支援分庫分表自動生成實體APP套件
- 虛擬主機支援哪些擴充套件功能套件
- 不改表結構如何動態擴充套件欄位套件
- 「擴充套件包推薦」蘑菇丁 SDK—自動簽到套件
- 【Kotlin】擴充套件屬性、擴充套件函式Kotlin套件函式
- 如何選擇Kubernetes叢集最佳的自動擴充套件策略? - Daniele套件
- 分散式雲的擴充套件自動化需要考慮什麼分散式套件
- 【ASP.NET Core】MVC 控制器的模型繫結(巨集觀篇)ASP.NETMVC模型
- ?用Chrome擴充套件管理器, 管理你的擴充套件Chrome套件
- CentOS安裝RabbitMQ及PHP擴充套件CentOSMQPHP套件
- python自帶快取lru_cache用法及擴充套件(詳細)Python快取套件
- Azure Load Balancer : 動態擴充套件套件
- ASP.NET Core擴充套件庫之實體對映ASP.NET套件
- KServe:一個健壯且可擴充套件的雲原生模型伺服器套件模型伺服器
- PHP擴充套件開發就是一個自己的PHP擴充套件PHP套件
- if-else擴充套件結構練習套件
- 如何自動擴充套件K8S儲存池容量?套件K8S
- 一個根據資料庫自動生成model類的擴充套件資料庫套件