开发者

asp.net mvc3,razor,jquery mobile view Navigation problem

I navigate from one mobile page to another, the page appears but the controls on the page

won't appears, i am using jquery mobile and mvc 3 with razor here is my code

Main Navigation Link controller for action.

public ActionResult List()
{
    if (Request.Browser.IsMobileDevice)
    {
        return View("List");
    }
    else
        return View("ListM");
}

View for link which will navigate the File controller

@{
    Page.Title = "ListM";
    Layout = "~/Views/Shared/_LayoutMob.cshtml";
}
<div>
    <ul data-role="listview" >    
        <li>
            @Html.ActionLink("FileLink", "List", "File")
        </li>
    </ul>
</div>

this is the _LayoutMob.cshtml Page(just like master)

<!DOCTYPE html>
@using DomainModel.Extentions;
<html lang="en开发者_开发问答">
    <head>
    <meta charset="utf-8" />
    <title>@ViewBag.Title</title>
    <link rel="stylesheet" href="http://code.jquery.com/mobile/1.0a3/jquery.mobile-1.0a3.min.css" />
    <script src="http://code.jquery.com/jquery-1.5.min.js"></script>    
    <script src="http://code.jquery.com/mobile/1.0a3/jquery.mobile-1.0a3.min.js"></script>
    <style type="text/css">
    body { background: #dddddd;} 
    .gmap { height: 330px; width: 100%; margin: 0px; padding: 0px }
    </style>

    </head>
    <body data-role="page" data-theme="e"> 
        @RenderBody()
    </body>
</html>

This is for the Controller(i.e the link where the navigation should come)

public ActionResult List()
{
    if (Request.Browser.IsMobileDevice)
    {  
        return View("ListM");
    }
}

Browser i am using are Mozilla Firefox,IE8 and iBB Demo2.


should this

public ActionResult List()
{
    if (Request.Browser.IsMobileDevice)
    {
        return View("List");
    }
    else
        return View("ListM");
}

be this

public ActionResult List()
{
    if (Request.Browser.IsMobileDevice)
    {
        return View("ListM");
    }
    else
        return View("List");
}

?

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜