读书人

Helper的运用

发布时间: 2012-12-18 12:43:41 作者: rapoo

Helper的应用

helper只能在Views中使用,下面创建了一个超级链接:<%=Html.ActionLink("首页", "index", "home")%>其实helper不仅仅这一种写法,我们同样可以将所有asp.net服务器控件写为helper控件,如下:    <%=Html.ActionLink("首页", "index", "home")%>    <%=Html .TextBox ("text") %>    <%=Html .Label  ("hek") %>    <%=Html .Encode ("hello") %>       //用户输出,相当于Response.Write("hello");

读书人网 >编程

热点推荐