如何在'/'应用程序中解决服务器错误。请帮忙 [英] How to solve server error in '/' application. Please help

查看:93
本文介绍了如何在'/'应用程序中解决服务器错误。请帮忙的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

I'm following a tutorial on how to build a website with MVC. I created the project as Web under C#, then chose Empty from ASP.Net 4.6.1 Templates and chose the option MVC.

I created two new folders and added bootstrap, CSS, and fonts files to these new folders.

I also created a new folder under View folder and then added Layout Page (Razor v3).


Then after I added the following code

------------------------------------------------------

<pre><title>@Page.Title</title>

    <link href="~/Content/bootstrap.min.css" rel="stylesheet" />
</head>
<body>

    <!--Navbar-->
    <Nav class="navbar navbar-default navbar-fixed-top">
        <div class="container">

            <div class="row">

                <div class="col-sm-4">.col-sm-4</div>
                <div class="col-sm-4">.col-sm-4</div>
                <div class="col-sm-4">.col-sm-4</div>
            </div>

            <div class="navbar-header">
                <button class="navbar-toggle collapsed" data-toggle="collapase"
                        data-target="#navbar">
                    <span class="icon-bar"></span>
                    <span class="icon-bar"></span>
                    <span class="icon-bar"></span>

                </button>
                <a href="#" class="navbar-brand">
                    <img src="" />
                </a>

            </div>

            <div id="navbar" class="navbar-collapse">
                <ul class="nav navbar-nav">
                    <li>
                        <a href="#">
                            
                            Main
                        </a>

                    </li>

                    <li>
                        <a href="#">
                            
                            Food Menu
                        </a>
                    </li>

                    <li>
                        <a href="#">
                            
                            Registeration
                        </a>
                    </li>
                    <li>
                        <a href="#">
                            
                            About
                        </a>
                    </li>


                </ul>
            </div>
        </div>

    </Nav>

    @RenderBody()

    <!--Footer-->
    <script src="~/Scripts/jquery.js"></script>
    <script src="~/Scripts/bootstrap.min.js"></script>

   
</body>
</html>







---------- --------------------------------



我有以下错误



'/'应用程序中的服务器错误。

HTTP 404.您要查找的资源(或其中一个依赖项)可能已被删除,名称已更改或暂时不可用。请查看以下网址并确保拼写正确。



我尝试过:






------------------------------------------

I got the following error

Server Error in '/' Application.
HTTP 404. The resource you are looking for (or one of its dependencies) could have been removed, had its name changed, or is temporarily unavailable. Please review the following URL and make sure that it is spelled correctly.

What I have tried:

I have searched and found many answers, but most of them are hard to follow, so I could not solve the issue. Please guide me to solve the problem.

推荐答案

您能否查看 index.cshtml的位置文件(或您的视图)。它应该位于名为 home 的子文件夹中的 views 文件夹下,或者位于以您的控制器命名的子文件夹中名称。如果将其放在其他位置,则可能会发生错误。



查看这篇文章 [ ^ ]



您可以在许多网站上获得详细的教程。以下是非常有用的



点击此处查看教程链接 [ ^ ]
Can you please check the location of index.cshtml file( or your view). it should be under the views folder in a sub-folder called home or in a sub-folder named with your controller name. If you place it on a different location the error can occur.

check this article[^]

you can get a detailed tutorial in many websites. The below one is very useful

Click here for the tutorial link[^]


这篇关于如何在'/'应用程序中解决服务器错误。请帮忙的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆