Hello,
In have a controller class that handle a Contact object. In this controller I have defined some actions like the two I am showing here
public ActionResult Edit(int id)
{
ContactModel cm = loadContactModel(id);
cm.ModelState = ModelStateEnum.Edit;
return PartialView("Contact", cm);
}
public ActionResult AddAddress(int id)
{
AddressModel am = new AddressModel() { ModelState = ModelStateEnum.Add };
return PartialView("Address", am);
}
The first load the Contact Detail view to edit a contact and the second load an Address detail view to add an Address to a Contact. On the UI side I have, in the same page, a button and an anchor that respectively call the same javascript function, this one
function loadDialog(action, id, title) {
$("#contactPanel").dialog("option", "title", title);
var urlAction = action;
if (id != "") urlAction = urlAction + "/" + id;
$.ajax({
type: "get",
dataType: "html",
url: urlAction,
data: {},
success: function(response) {
$("#contactPanel").html('').html(response).dialog('open');
}
});
}
This function simply load a jQuery dialog and set its content to what is returned back from the ajax call.
The problem is that when I call the AddAddress action I get HTTP/1.1 500 Internal Server Error.
I have used Fiddler to look at the http request and this is what I see
Any suggestion???