Hello I am using ASP.NET partial views like in this example
<% using (Html.BeginForm()) { %>
<table cellspacing="2" cellpadding="0" border="0" width="100%">
<tr>
<td><%= Html.LabelFor(model => model.PersonName)%></td>
<td>
<%= Html.TextBoxFor(model => model.PersonName)%>
<%= Html.ValidationMessageFor(model => model.PersonName, "*")%>
</td>
</tr>
...
<tr><td colspan="2"><%= Html.ValidationSummary(false) %></td></tr>
</table>
<% } %>
I show these partial views in Jquery dialogs calling them using jquery code
$.ajax({
type: "get",
dataType: "html",
url: urlAction,
data: {},
success: function(response) {
$("#panelDetail").html('').html(response).dialog('open');
}
});
and everything works and make me happy. I am also able to submit the form using jquery ajax and this make me even more happy. :)
What is really annoying is that I did not understand where validation occurs because, when it happens, it does a full refresh of the page and close the dialog.
I am sure that somebody can help on this. Anyway....who will be? :)
Thanks in advance!
EDIT:
This is the controller action signature with some code in it
[HttpPost]
public ActionResult MyAction(FormCollection form) {
string foroID = form["ForoId"];
string foro = form["Foro"];
string authorityId = form["AuthorityId"];
string sezione = form["Sezione"];
...
}
Do I have to re-create the model class to validate it?