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");

你可能感兴趣的:(html,应用服务器,.net,asp.net,asp)