jQuery Mobile的布局ASP.NET MVC应用程序 [英] jQuery Mobile layout in ASP.NET MVC app

查看:164
本文介绍了jQuery Mobile的布局ASP.NET MVC应用程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

短:

你把数据角色部分?(头|内容|页脚)在布局/母版页或在ASP.NET MVC每个视图

Do you put the data-role portions (header|content|footer) in your layout/master page or in each view in ASP.NET MVC?

长:

试图找到与处理的jQuery移动布局最佳实践。该文档(及其他)显示:

Trying to find the 'best practice' with handling jQuery mobile layout. The docs (and some others) show:

<!DOCTYPE html> 
<html> 
    <head> 
    <title>Page Title</title> 
        ...
</head> 
<body>
<div  data-role="page"> 
    <div  data-role="header">...</div> 
    <div  data-role="content">@RenderBody()</div> 
    <div  data-role="footer">...</div> 
</div>
</body>
</html>

不过,我已经看到了这太:

However I have seen this too :

<!DOCTYPE html> 
<html> 
    <head> 
    <title>Page Title</title> 
        ...
</head> 
<body>
<div  data-role="page">     
     @RenderBody()
</div>
</body>
</html>

使用是每一个观点:

<div  data-role="page"> 
    <div  data-role="header">...</div> 
    <div  data-role="content">...</div> 
    <div  data-role="footer">...</div> 
</div> 

那么,你定义头|在ASP.NET或布局/船长视图页脚|内容?一个更好?它是否在所有问题?

So, do you define the header|content|footer in each 'view' in ASP.NET or in the layout/master? Is one better? Does it matter at all?

推荐答案

就个人而言,我已经使用了第二次练习的鸵鸟政策重复自己动手的缘故了。

Personally, I've been using the second practice for Don't-Repeat-Yourself sake.

这篇关于jQuery Mobile的布局ASP.NET MVC应用程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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