Note that there are some explanatory texts on larger screens.

plurals
  1. POMVC Partial view update and Error redirection
    primarykey
    data
    text
    <pre><code>$.ajax({ type: "POST", url: "Sample/Test", dataType: "html", async: false, success: function (resp) { } }) </code></pre> <p>Am making an Ajax call to Controller and my Controller returns the Partial View <strong>(ActionResult)</strong> and i update the HTML of the particular div in the page. Looks good.</p> <p>In case if there are any Error happening in the controller it returns an Error page which is returned to the Ajax Success.</p> <p>I have 2 problems here</p> <ol> <li>In Straight forward scenario the Error page is set in the partial Div</li> <li>In some scenarios am finding dynamically div id and then updating that section alone. As Error page is the div is undefined and nothing happens.</li> </ol> <p>How do i make it redirect to the Error page instead of partially updating in case of Error.</p> <p>Even i tried with try catch where in Catch i returned the View instead of partial view. But that didnt worked.</p> <p>I tried redirecting from below code as well</p> <pre><code>protected void Application_Error(object sender, EventArgs e) { Response.Redirect("~/Error/Error"); } </code></pre> <p>This also returns the Error page to ajax success.</p> <p>What is the best way to redirect to full Error page as i have multiple ajax calls in my application?</p> <p>Other approach i came across is to find the text in the success and redirect there. is that a good approach ?</p> <p>Any common way to implement that way as i have ajax calls in multiple places. </p> <p>Thanks</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload