namespace System.Web.Mvc
{
using System;
using System.Globalization;
///
/// Fckeditor的HTMLHelper
/// http://chsword.cnblogs.com/
///
static public class FckTextBoxExt
{
///
/// Fckeditor的HTMLHelper,可以与同名ViewData绑定
///
/// HtmlHelper
/// Html的NAME
///
public static string FckTextBox( this HtmlHelper u, string name)
{
return u.FckTextBox(name, null );
}
///
/// Fckeditor的HTMLHelper
///
///
/// Html name
/// 内容
///
public static string FckTextBox( this HtmlHelper u, string name, object value)
{
return u.FckTextBox(name, value.ToString());
}
///
/// Fckeditor的HTMLHelper
///
///
/// Html name
/// 内容
///
public static string FckTextBox( this HtmlHelper u, string name, string value)
{
if (value == null )
{
value = Convert.ToString(u.ViewDataContainer.ViewData[name], CultureInfo.InvariantCulture);
}
return string .Format( @" {1}
" , name, value);
}
}
}
用法
View页写
即可
Controller写
ViewData["content"]="
....
";
即可与之绑定
来自 “ ITPUB博客 ” ,链接:http://blog.itpub.net/12639172/viewspace-329642/,如需转载,请注明出处,否则将追究法律责任。
转载于:http://blog.itpub.net/12639172/viewspace-329642/