views:

14

answers:

0

The following code does not work:

<h2>Admit</h2>
<br />
<div>
<% using(Ajax.BeginForm("Find", "XYZ", new AjaxOptions { UpdateTargetId = "results" })) %>
<% { %>
    <%= Html.TextBox("query", null, new { size = 40 }) %>
    <input type="submit" value="Submit" />
<% } %>
</div>

<div id="results">
  Results here....
</div>

while the code with the erroneous comment does - can anyone shed some light on why?

<h2>Admit</h2>
<br />
<div>
<!-- 
<% using(Ajax.BeginForm("Find", "XYZ", new AjaxOptions { UpdateTargetID = "results" })) %>

--> <% using(Ajax.BeginForm("Find", "XYZ", new AjaxOptions { UpdateTargetId = "results" })) %> <% { %> <%= Html.TextBox("query", null, new { size = 40 }) %> <% } %>

<div id="results">
  Results here....
</div>