asp.net mvc 3 - How to redirect to view from shared folder -


httpcontext.response.redirect("~/shared/views/error.cshtml", true); 

this not working me

and how exclude controllers , actions

as can see in documentation, method trying use require arguments

public void redirect(string url, bool endresponse) 

and first argument url of page user should redirected, while passing view file path. in asp. mvc path *cshtml file not equal url.

i suggest use redirecttoroute method instead

redirecttoroute(new routevaluedictionary  {     controller = "error",      action = "index" })  

where desired view returned errorcontroller.index() action.


Comments

Popular posts from this blog

c# - Validate object ID from GET to POST -

node.js - Custom Model Validator SailsJS -

php - Find a regex to take part of Email -