asp.net mvc 5 - The view 'name' or its master was not found or no view engine supports the searched locations -


i'm getting error message, , of advice i've seen not appear applicable; i.e. views, controllers , models in correct folders.

more detail: have master view, shows graphical flowchart-like interface interacting application. user selects "open study" symbol, , redirect view allows user select study work with.

the openstudycontroller code retrieves selected study , redirects master view:

public actionresult selectstudy( guid? id ) {     // code elided clarity      return redirecttoaction( "activatestudy", "home" ); } 

homecontroller has method called activatestudy(...), invoked appropriate environment:

public actionresult activatestudy() {     // code elided clarity      return view(); } 

as said, views, controllers , models in correct folders.

when "return view()" code in activatestudy() executed, error message occurs:

server error in '/' application.

the view 'activatestudy' or master not found or no view engine supports searched locations.the following locations searched: ~/views/home/activatestudy.aspx ~/views/home/activatestudy.ascx ~/views/shared/activatestudy.aspx ~/views/shared/activatestudy.ascx ~/views/home/activatestudy.cshtml ~/views/home/activatestudy.vbhtml ~/views/shared/activatestudy.cshtml ~/views/shared/activatestudy.vbhtml

what missing? additional parameter in redirecttoaction(...)? new entry in routeconfig?

if have _viewstart.cshtml , contains following not need specify same layout in each view.

@{     layout = "~/views/shared/_layout.cshtml"; } 

i believe problem might related missing slash. in comment said view contained following line:

layout = "~views/shared/_layout.cshtml" 

i think needs have slash after tilde.

layout = "~/views/shared/_layout.cshtml" 

but, said, should able remove line entirely.


Comments

Popular posts from this blog

php - failed to open stream: HTTP request failed! HTTP/1.0 400 Bad Request -

java - How to filter a backspace keyboard input -

java - Show Soft Keyboard when EditText Appears -