为什么HTML助手不输出这个ASP MVC视图中的任何内容?

Geo*_*uer 1 asp.net asp.net-mvc

下面是我的asp mvc视图.请注意,它有一个包含简单表单的div.我使用Html.TextBox()来尝试输出输入元素但没有输出.表单呈现正确,但我希望看到输入标记没有任何内容.

我确定这是一个初学者的错误,但我做错了什么?

<%@ Page Language="C#" MasterPageFile="~/Views/Shared/Site.Master" AutoEventWireup="true" 
    Inherits="System.Web.Mvc.ViewPage" %>
<%@ Import Namespace="gnodotnet.Web.Controllers" %>

<asp:Content ID="indexContent" ContentPlaceHolderID="MainContentPlaceHolder" runat="server">
    <div id="sponsorsContainer" class="container" style="width: 110px; float: left; height:482px; margin-right: 20px;"> &nbsp; </div>
    <div id="calendarContainer" class="container" style="width: 500px; height: 482px; float: left;"> &nbsp;
        <iframe src="http://www.google.com/calendar/embed?height=462&amp;wkst=1&amp;bgcolor=%23FFAD57&amp;src=ck1tburd835alnt9rr3li68128%40group.calendar.google.com&amp;color=%23AB8B00&amp;ctz=America%2FChicago" style=" border-width:0 " width="482" height="462" frameborder="0" scrolling="no"></iframe>
    </div>    
    <div id="mailingListContainer" class="container" style="width: 95px; float: left; height:182px; margin-left: 20px;"> 
        <% using (Html.BeginForm()) { %>
            <%= Html.AntiForgeryToken() %>
           <h4>Subscribe to our Mailing List</h4>
           Name: <% Html.TextBox("subscribeName"); %>
           Email: <% Html.TextBox("subscribeEmail"); %>
           <% Html.Button("subcribeOk", "Subscribe", HtmlButtonType.Submit); %>
       <% } %>
    </div>
</asp:Content>
Run Code Online (Sandbox Code Playgroud)

spe*_*der 5

使用

<%=Html.TextBox
Run Code Online (Sandbox Code Playgroud)

代替

<% Html.TextBox
Run Code Online (Sandbox Code Playgroud)

<%=等同于Response.Write,而<%仅仅打开代码块.