Microsoft.Web.Mvc Assembly 说明

简介: IHtmlElement  A Html Element's Interface. Html标签的一个接口规范。 C#: public interface IHtmlElement {     // Properties    IDictionary Attributes { get...

IHtmlElement

 A Html Element's Interface.
Html标签的一个接口规范。 C#:

public   interface  IHtmlElement
{
    
//  Properties
    IDictionary < string string >  Attributes {  get ; }
    
string  InnerHtml {  get set ; }
    
string  TagName {  get ; }
}

ButtonBuilder

To Builter a Button HTML tag with some attr.
用一些属性来构造Button的Html标签的构造器。
C#:
public   static   class  ButtonBuilder
{
    
//  Methods
     public   static  IHtmlElement Button( string  name,  string  buttonText,  string  onClickMethod, IDictionary < string object >  htmlAttributes);
    
public   static  IHtmlElement SubmitButton( string  name,  string  buttonText, IDictionary < string object >  htmlAttributes);
    
public   static  IHtmlElement SubmitImage( string  name,  string  sourceUrl, IDictionary < string object >  htmlAttributes);
}

 

RequireHttpMethodAttribute

Base Class:ActionFilterAttribute
可以批量设置可用的Action的列表。


[RequireHttpMethod( " index " , " about " )]
public   class  HomeController{}

则只有home/index与home/about是可以访问的。

ViewExtensions

HtmlHelperViewPage的扩展
增加了RenderAction及RenderRoute的扩展
定义
public   static   class  ViewExtensions
{
    
//  Methods
     public   static   void  RenderAction < TController > ( this  HtmlHelper helper, Expression < Action < TController >>  action)  where  TController: Controller;
    
public   static   void  RenderAction( this  HtmlHelper helper,  string  actionName);
    
public   static   void  RenderAction( this  HtmlHelper helper,  string  actionName,  string  controllerName);
    
public   static   void  RenderAction( this  HtmlHelper helper,  string  actionName,  string  controllerName,  object  values);
    
public   static   void  RenderAction( this  HtmlHelper helper,  string  actionName,  string  controllerName, RouteValueDictionary values);
    
public   static   void  RenderRoute( this  HtmlHelper helper, RouteValueDictionary values);
}




使用方法:



<%=Html.RenderUserControl("~/views/user/index-account.ascx", ViewData.Model)%>



MailToExtensions

增加了HtmlHelper的MailTo方法:



可以支持默认的转发及设置标题内容



public   static   class  MailToExtensions
{
    
//  Methods
     public   static   string  Mailto( this  HtmlHelper helper,  string  linkText,  string  emailAddress);
    
public   static   string  Mailto( this  HtmlHelper helper,  string  linkText,  string  emailAddress, IDictionary < string object >  htmlAttributes);
    
public   static   string  Mailto( this  HtmlHelper helper,  string  linkText,  string  emailAddress,  object  htmlAttributes);
    
public   static   string  Mailto( this  HtmlHelper helper,  string  linkText,  string  emailAddress,  string  subject);
    
public   static   string  Mailto( this  HtmlHelper helper,  string  linkText,  string  emailAddress,  string  subject, IDictionary < string object >  htmlAttributes);
    
public   static   string  Mailto( this  HtmlHelper helper,  string  linkText,  string  emailAddress,  string  subject,  object  htmlAttributes);
    
public   static   string  Mailto( this  HtmlHelper helper,  string  linkText,  string  emailAddress,  string  subject,  string  body,  string  cc,  string  bcc, IDictionary < string object >  htmlAttributes);
    
public   static   string  Mailto( this  HtmlHelper helper,  string  linkText,  string  emailAddress,  string  subject,  string  body,  string  cc,  string  bcc,  object  htmlAttributes);
}

ImageExtensions

HtmlHelepr的图片显示扩展:



public   static   class  ImageExtensions
{
    
//  Methods
     public   static   string  Image( this  HtmlHelper helper,  string  imageRelativeUrl);
    
public   static  IHtmlElement Image( string  imageUrl,  string  alt, IDictionary < string object >  htmlAttributes);
    
public   static   string  Image( this  HtmlHelper helper,  string  imageRelativeUrl, IDictionary < string object >  htmlAttributes);
    
public   static   string  Image( this  HtmlHelper helper,  string  imageRelativeUrl,  object  htmlAttributes);
    
public   static   string  Image( this  HtmlHelper helper,  string  imageRelativeUrl,  string  alt);
    
public   static   string  Image( this  HtmlHelper helper,  string  imageRelativeUrl,  string  alt, IDictionary < string object >  htmlAttributes);
    
public   static   string  Image( this  HtmlHelper helper,  string  imageRelativeUrl,  string  alt,  object  htmlAttributes);
}

ButtonsAndLinkExtensions

HtmlHelper的扩展



增加了Button,SubmitButton,SubmitButton的支持



public   static   class  ButtonsAndLinkExtensions
{
    
//  Methods
     public   static   string  Button( this  HtmlHelper helper,  string  name,  string  buttonText,  string  onClickMethod);
    
public   static   string  Button( this  HtmlHelper helper,  string  name,  string  buttonText,  string  onClickMethod, IDictionary < string object >  htmlAttributes);
    
public   static   string  Button( this  HtmlHelper helper,  string  name,  string  buttonText,  string  onClickMethod,  object  htmlAttributes);
    
public   static   string  SubmitButton( this  HtmlHelper helper);
    
public   static   string  SubmitButton( this  HtmlHelper helper,  string  name);
    
public   static   string  SubmitButton( this  HtmlHelper helper,  string  name,  string  buttonText);
    
public   static   string  SubmitButton( this  HtmlHelper helper,  string  name,  string  buttonText, IDictionary < string object >  htmlAttributes);
    
public   static   string  SubmitButton( this  HtmlHelper helper,  string  name,  string  buttonText,  object  htmlAttributes);
    
public   static   string  SubmitImage( this  HtmlHelper helper,  string  name,  string  imageSrc);
    
public   static   string  SubmitImage( this  HtmlHelper helper,  string  name,  string  imageSrc, IDictionary < string object >  htmlAttributes);
    
public   static   string  SubmitImage( this  HtmlHelper helper,  string  name,  string  imageSrc,  object  htmlAttributes);
}

 

Wiki:http://www.eice.com.cn/Microsoft_Web_Mvc.ashx

目录
相关文章
|
SQL 数据库
Microsoft SQL Server 2000数据还原
Microsoft SQL Server 2000还原数据操作流程 1、开始 - 所有程序 - Microsoft SQL Server - 企业管理器(如图1-1)。
1099 0
|
SQL 数据库
Microsoft SQL Server 2000数据附加
Microsoft SQL Server 2000附加数据操作流程 1、开始 - 所有程序 - Microsoft SQL Server - 企业管理器(如图1-1)。
1096 0
|
SQL 数据库 Windows
Microsoft SQL Server 2008数据还原
Microsoft SQL Server 2008还原数据操作流程 1、开始 - 所有程序 - Microsoft SQL Server 2008 R2 - SQL Server Management Studio(如图1-1)。
1116 0
|
SQL 数据库 Windows
Microsoft SQL Server 2000数据库备份
Microsoft SQL Server 2000备份数据操作流程 1、开始 - 所有程序 - Microsoft SQL Server - 企业管理器(如图1-1)。
1218 0
|
SQL 监控 数据库
Microsoft SQL Server 2008清理LDF日志
Microsoft SQL Server 2008 LDF数据文件清理方法。 PS:由于该操作涉及数据库中的数据,请在操作前先做好数据备份。 准备:Microsoft SQL Server 2008清理LDF脚本,请点击下载获取。
1673 0
|
SQL 数据库 Windows
Microsoft SQL Server 2008修改混合模式
数据库身份验证SQL Server和Windows设置 1、开始 - 所有程序 - Microsoft SQL Server 2008 R2 - SQL Server Management Studio(如图1-1) 图 1-1 2、进入后会弹出窗口【连接到服务器】,在【身份验证】选择中【Windows身份验证】— 点击【连接】(如图1-2) 图 1-2 3、在数据库服务实例名(如图1-3,WIN-VQ5SKTLJ9EU\sql位置)点击鼠标右键【属性】。
1192 0
|
SQL 数据库 数据安全/隐私保护
Microsoft SQL Server 2008修改sa密码
数据库sa密码忘记处理方案 1、开始 - 所有程序 - Microsoft SQL Server 2008 R2 - 点击SQL Server Management Studio(如图1-1)。
1552 0
|
SQL 数据库 数据安全/隐私保护
Microsoft SQL Server 2000修改sa密码提示错误:2812
报错提示:错误 2812:未能找到存储过程 ‘ sp_password ’。 准备:存储过程修复脚本,请点击下载获取。下载完毕后,请放置C盘根目录并解压。
1091 0
|
SQL 数据库 Windows
Microsoft SQL Server 2000修改混合模式
数据库身份验证SQL Server和Windows设置 1、开始—所有程序—Microsoft SQL Server—企业管理器,进入Microsoft SQL Server 2000数据库中(如图1-1)。
1217 0
|
SQL 数据库 Windows
Microsoft SQL Server 2000收缩MDF数据
Microsoft SQL Server 2000 MDF数据文件清理方法。 PS:由于该操作涉及数据库中的数据,请在操作前先做好数据备份。 准备:Microsoft SQL Server 2000收缩MDF脚本,请点击下载获取。
1124 0