Click here to Skip to main content
14,266,194 members

Web Development

 
AnswerRe: Razor Pages and Layout.cshtml Pin
Maciej Los16-Apr-19 23:17
protectorMaciej Los16-Apr-19 23:17 
GeneralRe: Razor Pages and Layout.cshtml Pin
Mycroft Holmes19-Apr-19 15:35
memberMycroft Holmes19-Apr-19 15:35 
AnswerRe: Razor Pages and Layout.cshtml Pin
#realJSOP22-Apr-19 2:50
mve#realJSOP22-Apr-19 2:50 
GeneralRe: Razor Pages and Layout.cshtml Pin
Member 143592847-May-19 16:45
memberMember 143592847-May-19 16:45 
QuestionFatal error: Uncaught Error: Call to a member function prepare() Pin
Member 1426306215-Apr-19 20:49
memberMember 1426306215-Apr-19 20:49 
AnswerRe: Fatal error: Uncaught Error: Call to a member function prepare() Pin
Richard MacCutchan15-Apr-19 21:25
protectorRichard MacCutchan15-Apr-19 21:25 
QuestionCan I put SQLite database in a folder before root folder(public-html folder where index.php file could be placed in) of server and give the database folder full time read and write access permission? Pin
AndroidVH13-Apr-19 18:15
memberAndroidVH13-Apr-19 18:15 
QuestionMVC5 New Controller/View gives 404 Pin
#realJSOP12-Apr-19 1:56
mve#realJSOP12-Apr-19 1:56 
Using VS2017, writing a MVC5 app...

I added a new controller, and a view to go with it (not using the scaffolding thing, just creating them individually). Something I've done dozens of times.

In the Controllers folder I have this class:

DemosController

And in that class, I have:
public ActionResult DemoTreeView()
{
    return View();
}
In the Views folder, I have a Demos folder, and in thast folder I have this file:

DemoTreeView.cshtml

When I try to "render in browser", I get a 404 error saying that "mynewcontroller/mynewview" couldn't be found.

What I Tried

0) I verified that the controller and view are named appropriately.

1) I tried deleting the view and recreating it

2) I tried decorating the associated ActionResult method in the controller with HttpGet and AllowAnonymous (neither of which should be necessary).

3) I tried doing the same controller/view creation in a new project (using VS2015), and it works fine (this was just to proved to myself that what I was doing was appropriate).

I'm out of ideas...

EDIT ===================================

Well, I tried it by creating the controller with get/set methods, and it created the views folder for me. When I moved the views to that folder and added the appropriate methods to the controller, it worked.

My (rhetorical) question is why does it matter how I created the folder if all the necessary parts are there?
".45 ACP - because shooting twice is just silly" - JSOP, 2010
-----
You can never have too much ammo - unless you're swimming, or on fire. - JSOP, 2010
-----
When you pry the gun from my cold dead hands, be careful - the barrel will be very hot. - JSOP, 2013


modified 12-Apr-19 13:29pm.

AnswerRe: MVC5 New Controller/View gives 404 Pin
Richard Deeming15-Apr-19 8:34
mveRichard Deeming15-Apr-19 8:34 
GeneralRe: MVC5 New Controller/View gives 404 Pin
#realJSOP15-Apr-19 8:44
mve#realJSOP15-Apr-19 8:44 
QuestionHow to download and save multiple files into the same folder with reactjs Pin
asb1469010-Apr-19 21:43
memberasb1469010-Apr-19 21:43 
QuestionWeb API Security Pin
Kevin Marois3-Apr-19 9:43
professionalKevin Marois3-Apr-19 9:43 
AnswerRe: Web API Security Pin
Vinod Jangle4-Apr-19 9:52
memberVinod Jangle4-Apr-19 9:52 
QuestionMVC5 validation decoration Pin
#realJSOP1-Apr-19 0:55
mve#realJSOP1-Apr-19 0:55 
AnswerRe: MVC5 validation decoration Pin
#realJSOP1-Apr-19 2:07
mve#realJSOP1-Apr-19 2:07 
GeneralRe: MVC5 validation decoration Pin
malkovich198823-Apr-19 5:08
membermalkovich198823-Apr-19 5:08 
QuestionIs there a basic HTML scripts bundle for VS code and none serve application? Pin
maze327-Mar-19 5:05
professionalmaze327-Mar-19 5:05 
AnswerRe: Is there a basic HTML scripts bundle for VS code and none serve application? Pin
Shmuel Zang28-Mar-19 4:08
memberShmuel Zang28-Mar-19 4:08 
AnswerRe: Is there a basic HTML scripts bundle for VS code and none serve application? Pin
Richard MacCutchan28-Mar-19 5:02
protectorRichard MacCutchan28-Mar-19 5:02 
QuestionExperimenting Pin
Member 1419652225-Mar-19 20:42
memberMember 1419652225-Mar-19 20:42 
AnswerRe: Experimenting Pin
maze327-Mar-19 5:14
professionalmaze327-Mar-19 5:14 
QuestionCopy and Paste to aspx GridView Pin
Wayne Hollier20-Mar-19 1:30
memberWayne Hollier20-Mar-19 1:30 
AnswerRe: Copy and Paste to aspx GridView Pin
Richard Deeming20-Mar-19 13:02
mveRichard Deeming20-Mar-19 13:02 
GeneralRe: Copy and Paste to aspx GridView Pin
Wayne Hollier22-Mar-19 1:12
memberWayne Hollier22-Mar-19 1:12 
QuestionNo action was found on the controller Pin
Kevin Marois18-Mar-19 15:16
professionalKevin Marois18-Mar-19 15:16 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.