So my question is similar to this SO post but I can not simply overwrite the document.
I'm using MVC and am able to call a controller's entry point from a View
other than it's own.
the View (Say, ViewA) has a dialog, defined as:
$("#dialog-confirm").dialog({
autoOpen: false,
resizable: false,
height: 390,
width: 402,
modal: true,
buttons: {
"Confirm": function () {
$.ajax({
type: "GET",
url: '/Result/Result',
data: $(this).serialize(),
success: function(data)
{
window.location.href = "<%:Url.Action("~/Result/Result")%>";
}
});
$(this).dialog("close");
},
cancel: function(){ $(this).close();}}
});
When I confirm the dialog, I hit the entry point I wanted to in the ResultsController
, but then my browser navigates to localhost:8000/ViewA/~/Result/Result instead of localhost:8000/Result/Result
ResultController.cs
public ActionResult Result()
{
return RedirectToAction("Index");
}
How can I redirect to the page returned by Result()
in the different controller?