为什么asp.net mvc显示空白页面

时间:2012-11-26 16:44:18

标签: asp.net-mvc html-helper

我正在使用visual studio 2012学习mvc(移动模板)。我创建了我的实体,并为我的Client表(ClientController)添加了一个控制器和视图。
然后我在索引主页中添加了一个链接来查看客户端列表,但链接中没有显示任何内容。

 @Code
     ViewData("Title") = "Home Page"
 End Code

 <h2>@ViewData("Message")</h2>
 <p>
     @Html.ActionLink("Client", "Index", "Client")
</p>

 <ul data-role="listview" data-inset="true">
     <li data-role="list-divider">Navigation</li>
     <li>@Html.ActionLink("About", "About", "Home")</li>
     <li>@Html.ActionLink("Contact", "Contact", "Home")</li>
</ul>

我做错了什么?

由于

 <!DOCTYPE html>
 <html lang="en">
<head>
    <meta charset="utf-8" />
    <title>Home Page</title>
    <meta name="viewport" content="width=device-width" />
    <link href="/favicon.ico" rel="shortcut icon" type="image/x-icon" />
    <link href="/Content/jquery.mobile-1.2.0.css" rel="stylesheet"/>
 <link href="/Content/jquery.mobile.structure-1.2.0.css" rel="stylesheet"/>
 <link href="/Content/jquery.mobile.theme-1.2.0.css" rel="stylesheet"/>
 <link href="/Content/site.css" rel="stylesheet"/>

    <script src="/Scripts/modernizr-2.5.3.js"></script>

</head>
<body>
    <div data-role="page" data-theme="b">
        <div data-role="header">
                <h1>Home Page</h1>
 <a data-icon="gear" href="/Account/Login">Log in</a>            </div>
        <div data-role="content">


 <h2>Modify this template to jump-start your ASP.NET MVC application.</h2>
 <p>
     <a href="/Client">Client</a>
 </p>

 <ul data-role="listview" data-inset="true">
<li data-role="list-divider">Navigation</li>
<li><a href="/Home/About">About</a></li>
<li><a href="/Home/Contact">Contact</a></li>


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

    <script src="/Scripts/jquery-1.8.2.js"></script>
 <script src="/Scripts/jquery.mobile-1.2.0.js"></script>

    <script src="/Scripts/jquery-ui-1.8.20.js"></script>


</body>
 </html>

0 个答案:

没有答案