Reputation:
I am wondering how can I convert this helper to razor
<% Html.AjaxForm(s =>
{ %>
<div class="form2">
<br />
<label class="smallLabel" for="Name" >
Name : <span id="s_Name">*</span></label>
<%=Html.TextBox("Name", ViewData.Model.Name, new { @class = "smallTextBox" })%>
</div>
<% });%>
Upvotes: 0
Views: 111
Reputation: 11203
@using(Ajax.BeginForm(new AjaxOptions()))
{
<div class="form2">
<br />
<label class="smallLabel" for="Name" >Name : <span id="s_Name">*</span></label>
@Html.TextBoxFor(m => m.Name, new { @class = "smallTextBox" })
</div>
}
I strongly recommend you revisit razor syntax info
UPDATE
The following syntax:
@using(Html.BeginForm())
{
}
will render the following html:
<form>
</form>
Whatever you put inside the curvy brackets will be inside the <form>
tags.
Upvotes: 2