我如何在asp.net中使用HTML Helper?

时间:2017-12-14 10:41:04

标签: c# asp.net html-helper using

我想在ASP.net webform中添加一个HTML Helper(Html.BeginForm())。但是当我使用它时,我收到了编译错误。我在我的邮件下面添加了我的代码片段。可以帮助我我怎么能以怀特的方式使用它?

CODE

 <body>
<%  @using (Html.BeginForm("LoginControl", "Home", FormMethod.Post, new { 
  @class = "form-horizontal", role = "form" }))
 { %>
    <div class="container">
        <div class="row" >
            <div class="col-sm-6 col-md-4 col-md-offset-4" >
                <div class="account-wall" style="background-color:darkgrey">
                    <img class="profile-img" src="images/Logo.png"
                         alt=""/>
                    <form class="form-signin" runat="server">
                        <input type="text" runat="server"  class="form-
       control" id="UserName" placeholder="Kullanıcı Adı" required autofocus 
  />
                        <input type="text" runat="server"  class="form-
 control" id="Password" placeholder="Şifre" required />
                        <asp:button runat="server" ID="btnGiris" class="btn 
 btn-lg btn-primary btn-block" type="submit" Text="Giriş Yap" 
 OnClick="Unnamed1_Click"/>

                        <label>
                          <!-- <input type="checkbox" value="remember-me">
                            Remember me -->
                        </label>
                      <span class="clearfix"></span>
                    </form>
                </div>
            </div>
        </div>
    </div>
    <%  } %>
   </body>

0 个答案:

没有答案