Hi
This is a really strange issue. I have developed a small MVC application and have done testing up until now using the VS2008 built in dev server and everything works as I expect. I have now moved the solution to IIS hosted and I see different results in a view which uses an Ajax.ActionLink.
The actionlink links to a controller action which returns a partial view (.ascx). In the AjaxOptions of the link I specify the UpdateTargetId of the DOM element that I wish the partial view returned by the action to replace. When running the application using the built in dev server, behaviour is as expected -> the ajax call successfully returns the partialview and replaces the specified DOM element. However when hosted in IIS, the controller action is successfully executed but the result is rendered on a new page rather than replacing the specifed DOM element.
Here is relevant source for the page which makes the ajax call:
<% if (info.CurrentStatus != OrderStatus.Received &&
info.CurrentStatus != OrderStatus.Processing)
{ %>
<td><%= Ajax.ActionLink("Reprocess Order", "Reprocess",
new { generatedId = info.GeneratedId },
new AjaxOptions
{
UpdateTargetId = "success" + info.GeneratedId,
OnSuccess = "reprocessSuccess"
})%></td>
<% } %>
<td><%= Html.Div("success" + info.GeneratedId) %> </td>
And here is the action which provides the partial view:
[RequiresSearch()]
public ActionResult Reprocess(string generatedId)
{
if (RequestReprocessingOfOrder(generatedId))
{
ViewData["reprocessSuccess"] = "Reprocessing request successful. Order is queued for reprocessing";
}
else
{
ViewData["reprocessSuccess"] = "Reprocessing request failed. Please contact the administrator";
}
return PartialView();
}
Any help would be greatly appreciated!!!
EDIT: I don't have alot of mvc/ajax experience so am unsure as to where to event start to try and solve this, so even pointers of what to look for would be great.