Last post Oct 17, 2018 07:12 AM by Edward Z
Oct 15, 2018 03:05 PM|nishith.shri|LINK
I am using asp.net core exception handling middleware (app.UseExceptionHandler). I have written a code to display user friendly errors in Home Controller in Error action method. I have also written a code in Error.cshtml view to display the content in a
modal pop up.
Everything is working as expected. Error.cshtml is loading in a modal pop up. The challenge over here i am facing is that the Error.chtml is redirecting first and then loading a modal pop up (with a blank page in the background).
I am looking for a solution where i can load Error.cshtml in a modal pop up without having it redirected. i.e. on the same page where error is occuring (example: Edit).
If anyone has a suggestion on how to achieve this, that would be great.
For reference, I am doing what Edward has proposed in this thread: https://forums.asp.net/t/2130016.aspx
Oct 15, 2018 03:20 PM|mgebhard|LINK
A redirect, as suggested in your post, means a full refresh has been designed. The error handling returns an error page. If you want a model in the error page then add a modal to the error page.
If you want an error modal on the current page then redesign the application to use partial refresh which populates the modal. This is a feature found in Single Page Applications (SPA). Or redesign the error handler to return the current page with the
error modal embedded in the HTML.
Oct 17, 2018 07:12 AM|Edward Z|LINK
>>I am looking for a solution where i can load Error.cshtml in a modal pop up without having it redirected.
How did you implement a Error modal pop up?
Could you share us a demo which could reproduce your issue?