ASP.NET结合EasyUI实现界面布局

使用EasyUI也有一段时间了,现在总结一下其界面布局。首先EasyUI仿照ExtJS,将整个页面区域划分成了东(east)、南(south)、西(west)、北(north)、中(center)五个区域,在布局时center区域必须出现,其他区域随意。在VS中可通过NuGET引用EasyUI的相关文件.

<!DOCTYPE html>
<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <meta charset="utf-8" />
    <title>EasyUI测试</title>
    <link href="Content/themes/default/easyui.css" rel="stylesheet" />
    <link href="Content/themes/icon.css" rel="stylesheet" />
    <script src="Scripts/jquery-1.11.3.min.js"></script>
    <script src="Scripts/jquery.easyui-1.4.5.min.js"></script>
    <script src="Scripts/locale/easyui-lang-zh_CN.js"></script>
</head>
<body class="easyui-layout">
    <!--顶部区域-->
    <div data-options="region:'north',border:false" style="height:100px;background-color:darkblue;">

    </div>

    <!--左侧导航栏-->
    <div data-options="region:'west',split:true,title:'页面导航'" style="width:250px;">

    </div>

    <!--内容区域-->
    <div data-options="region:'center',title:'内容区域'">

    </div>

    <!--页面底部-->
    <div data-options="region:'south',border:true" style="height:25px;background-color:#e0ecff;">

    </div>
</body>
</html>

上面的代码通过五个div即可完成一个通用后台管理系统的大致布局,结果如下:
在这里插入图片描述接着添加一个CSS文件,设置一下各个区域内的相关样式。

body
{

}

a,
a:link
{
    color: #000;
    text-decoration: none;
    outline: none;
}

    a:hover,
    a:focus
    {
        text-decoration: none;
        color: #39f;
    }

.header
{
    height: 100px;
    position: relative;
    z-index: 0;
    overflow: hidden;
    border-bottom: 1px #95b8e7 solid;
    background-color: darkblue;
}

.header-left
{
    position: absolute;
    z-index: 1;
    margin-top: 25px;
    margin-left: 20px;
}

    .header-left h1
    {
        font: 20px/20px Verdana;
        color: white;
    }

.side-tree .tree-node
{
    padding: 3px 0px;
}

.side-tree a
{
    display: block;
}

.side-tree .tree-node-selected
{
    padding: 2px 0;
    border: 1px #fade23 solid;
}

.footer
{
    height: 20px;
    padding: 5px;
    text-align: center;
    overflow: hidden;
    background: #e0ecff;
}

在顶部添加一行文字:

    <!--顶部区域-->
    <div class="header" data-options="region:'north',border:false">
        <div class="header-left">
            <h1>ASP.NET + EasyUI测试</h1>
        </div>
    </div>

在左侧导航栏内添加一个EasyUI的手风琴控件:

    <!--左侧导航栏-->
    <div data-options="region:'west',split:true,title:'页面导航'" style="width:250px;">
        <div class="easyui-accordion" data-options="border:false,fit:true">
            <div data-options="title:'学生管理',iconCls:'icon-ok'" style="overflow:auto;">
                <ul class="easyui-tree side-tree">
                    <li iconcls="icon-lock">
                        <a href="javascript:void(0)" data-icon="icon-lock" data-link="account.html" iframe="0">信息管理</a>
                    </li>
                </ul>
            </div>
        </div>
    </div>

在底部添加一下版权信息:

    <!--页面底部-->
    <div class="footer" data-options="region:'south',border:true">
        &copy; 2019 DSF All Rights Reserved
    </div>

到目前为止,界面结果如下图:
在这里插入图片描述最后就是中间的内容区域。EasyUI的tab控件可以轻松实现多文档界面的生成。现在添加一个新的html文件,名称为home.html,其内容如下:

<!DOCTYPE html>
<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <title></title>
    <meta charset="utf-8" />
</head>
<body>
    <h1 style="text-align:center;">欢迎使用EasyUI,它能够帮助你进行快速布局</h1>
</body>
</html>

然后在center区域内添加一个tab,对home.html进行显示:

    <!--内容区域-->
    <div data-options="region:'center'">
        <div id="tabs" class="easyui-tabs" data-options="border:false,fit:true">
            <div title="网站首页" data-options="href:'home.html',closable:false,iconCls:'icon-tip'"></div>
        </div>
    </div>

结果如下:
在这里插入图片描述全部代码如下:

<!DOCTYPE html>
<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <meta charset="utf-8" />
    <title>EasyUI测试</title>
    <link href="Content/themes/default/easyui.css" rel="stylesheet" />
    <link href="Content/themes/icon.css" rel="stylesheet" />
    <link href="Content/Site.css" rel="stylesheet" />
    <script src="Scripts/jquery-1.11.3.min.js"></script>
    <script src="Scripts/jquery.easyui-1.4.5.min.js"></script>
    <script src="Scripts/locale/easyui-lang-zh_CN.js"></script>
</head>
<body class="easyui-layout">
    <!--顶部区域-->
    <div class="header" data-options="region:'north',border:false">
        <div class="header-left">
            <h1>ASP.NET + EasyUI测试</h1>
        </div>
    </div>

    <!--左侧导航栏-->
    <div data-options="region:'west',split:true,title:'页面导航'" style="width:250px;">
        <div class="easyui-accordion" data-options="border:false,fit:true">
            <div data-options="title:'学生管理',iconCls:'icon-ok'" style="overflow:auto;">
                <ul class="easyui-tree side-tree">
                    <li iconcls="icon-lock">
                        <a href="javascript:void(0)" data-icon="icon-lock" data-link="account.html" iframe="0">信息管理</a>
                    </li>
                </ul>
            </div>
        </div>
    </div>

    <!--内容区域-->
    <div data-options="region:'center'">
        <div id="tabs" class="easyui-tabs" data-options="border:false,fit:true">
            <div title="网站首页" data-options="href:'home.html',closable:false,iconCls:'icon-tip'"></div>
        </div>
    </div>

    <!--页面底部-->
    <div class="footer" data-options="region:'south',border:true">
        &copy; 2019 DSF All Rights Reserved
    </div>
</body>
</html>

Easyui开发框架源码 源码描述: 一、功能介绍: 本系统实现的核心功能完全适合企业级开发 1、框架采用多层架构,反射技术。 2、权限管理里实现的功能:按钮管理、菜单管理、角色管理、用户管理、数据字典、单号管理、日志管理等。通用于后台管理系统以及权限管理模块。 3、系统用到缓存技术,MemCached和Redis这2种,具体缓存资料网上很多。 二、目录结构: 01 Reference DLL 这里主要包括第三方的框架和组件项目,把这些文件分门别类地集中放在此目录下。 02 Solution Items 项目的规范、流程、重要文件等。 03 Test 这里主要放置测试需要的一些信息,如测试版本、测试文档等。 04 Publish 这个文件夹主要放置发布的版本。 05 Framework 主要包括数据访问框架、通用权限框架、异常和日志处理框架、IOC框架、AOP框架等基础或常用功能。 06 Bussiness JTS项目的业务文件夹。 07 UI 即User Interface,该层作为数据输入和展示的界面,是与用户交互的有效途径,所以它起着至关重要的作用。往往给人第一印象的就是UI层,在设计的时候也要根据不同的技术或者不同的要求进行斟酌。通常可以把UI分为B/S UI、C/S UI以及WEB服务。在这里就是我们的ASP.NET项目。 08 SOA 这一层不是必须的,根据项目的具体情况进行取舍,如果业务比较复杂且交互项目繁多,那么SOA可以减轻我们的负担;如果业务比较单一且相对简单,就可以直接调用或者使用Web Service/Remoting/WCF作为通信框架即可。在实施SOA的过程中,可以自己使用WCF+WF搭建一个小型轻量级的SOA框架,也可以使用诸如Biztalk等软件。 三、注意事项: 1、开发环境为Visual Studio 2010及以上,数据库为SQL Server 2008R2,数据库文件在DB文件夹中。
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值