MVCDemo-View-1
Site.Master:
<%@ Master Language="C#" Inherits="System.Web.Mvc.ViewMasterPage" %>
<!DOCTYPE html>
<html>
<head runat="server">
<meta name="viewport" content="width=device-width" />
<title><asp:ContentPlaceHolder ID="TitleContent" runat="server" /></title>
<link href="../../Scripts/jquery-easyui-1.4.1/themes/default/easyui.css" rel="stylesheet" />
<link href="../../Scripts/jquery-easyui-1.4.1/themes/icon.css" rel="stylesheet" />
<link href="../../Scripts/jquery-easyui-1.4.1/themes/color.css" rel="stylesheet" />
<link href="../../Scripts/jquery-easyui-1.4.1/demo/demo.css" rel="stylesheet" />
<script src="../../Scripts/jquery-easyui-1.4.1/jquery.min.js"></script>
<script src="../../Scripts/jquery-easyui-1.4.1/jquery.easyui.min.js"></script>
<script src="../../Scripts/ProdManage.js"></script>
</head>
<body>
<div>
<%-- <div id="header">
<h1>ProdManage Site</h1>
<ul id="navList">
<li class="first"><a href="/" id="current">Home</a></li>
<li><a href="/Store">Store</a></li>
</ul>
</div>--%>
<asp:ContentPlaceHolder ID="MainContent" runat="server">
</asp:ContentPlaceHolder>
</div>
</body>
</html>
Index.aspx:
<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage<ProdManage.ViewModels.StoreIndexViewModel>" %>
<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
Index
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
<h2>Browes Genres</h2>
<ul>
<%foreach(string name in Model.Genres)
{ %>
<li>
<%:name %>
</li>
<%} %>
</ul>
</asp:Content>
Part.aspx:
<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage<dynamic>" %>
<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
<script type="text/javascript">
$(document).ready(function () {
})
function search() {
//$.ajax({
// url: 'GetParts',
// type: 'get',
// dataType: 'json',
// data: ProdManage.serializeToJson($('#form')),
// success: function (result) {
// alert(result.length);
// },
//})
loadDataGrid($('#dg'), 'GetParts');
}
function loadDataGrid(dataGrid,url) {
dataGrid.datagrid('options').url = url;
//dataGrid.datagrid("load", ProdManage.serializeToJson($('#form')));
dataGrid.datagrid('options').queryParams = ProdManage.serializeToJson($('#form'));
dataGrid.datagrid('reload');
}
function AddPart() {
$('#dd').append("<iframe src='http://www.163.com'></iframe>")
$('#dd').window({
width: 600,
height: 400,
modal: true
});
}
</script>
<div style="height:100%; overflow:hidden">
<form id="form">
<input type="text" name="text1" value="text1value" />
<input type="text" name="text2" value="text2value" />
<input type="text" name="text3" value="text3value" />
<input type="text" name="text4" value="text4value" />
<input type="button" name="btnSearch" value="search" onclick="search()" />
</form>
<table id="dg" class="easyui-datagrid"
data-options="border:false,
idField:'PartID',
title: 'Part Information',
fitColumns:true,
width: 'auto',
height: 'auto',
fixed:true,
striped: true,
singleSelect: false,
method: 'POST',
loadMsg: '数据加载中请稍后……',
pagination: true,
rownumbers: true," toolbar="#tb">
<thead>
<tr>
<th data-options="field:'ck',checkbox:true " width="50" ></th>
<th data-options="field:'PartCode'" width="80">PartCode</th>
</tr>
</thead>
</table>
</div>
<div id="dd" title="My Dialog" class="easyui-window" title="My Window" closed="true" style="width:600px;height:480px;padding:5px;"></div>
<div id="tb">
<a href="#" class="easyui-linkbutton" iconCls="icon-add" plain="true" onclick="AddPart()">Add</a>
<a href="#" class="easyui-linkbutton" iconCls="icon-cut" plain="true" onclick="javascript:alert('Cut')">Cut</a>
<a href="#" class="easyui-linkbutton" iconCls="icon-save" plain="true" onclick="javascript:alert('Save')">Save</a>
</div>
</asp:Content>
Home\Index.aspx:
<%@ Page Language="C#" Inherits="System.Web.Mvc.ViewPage<dynamic>" %>
<!DOCTYPE html>
<html>
<head runat="server">
<meta name="viewport" content="width=device-width" />
<title>Home</title>
<link href="../../Scripts/jquery-easyui-1.4.1/themes/default/easyui.css" rel="stylesheet" />
<link href="../../Scripts/jquery-easyui-1.4.1/themes/icon.css" rel="stylesheet" />
<link href="../../Scripts/jquery-easyui-1.4.1/themes/color.css" rel="stylesheet" />
<link href="../../Scripts/jquery-easyui-1.4.1/demo/demo.css" rel="stylesheet" />
<script src="../../Scripts/jquery-easyui-1.4.1/jquery.min.js"></script>
<script src="../../Scripts/jquery-easyui-1.4.1/jquery.easyui.min.js"></script>
<script src="../../Scripts/ProdManage.js"></script>
<script type="text/javascript">
$(document).ready(function () {
//alert(ProdManage.serializeToJson($('#form')));
$('#NavTree').tree({
onClick: function (node) {
if (node.children == null)
addTab(node.text, node.attributes.url);
//addTab(node.text, 'Part/Part');
}
});
})
//function search()
//{
// $.ajax({
// url: 'Home/GetParts',
// type: 'get',
// dataType: 'json',
// data: ProdManage.serializeToJson($('#form')),
// success:function(result){
// alert(result.data);
// },
// })
//}
//function Open(text, url) {
// if ($("#tabs").tabs('exists', text)) {
// $('#tabs').tabs('select', text);
// } else {
// $('#tabs').tabs('add', {
// title: text,
// closable: true,
// content: text,
// url: url
// });
// }
//}
function addTab(subtitle, url) {
if ($('#tabs').tabs('exists', subtitle)) {
$('#tabs').tabs('select', subtitle);
}
else {
var content = '<iframe name="mainFrame" scrolling="no" frameborder="0" src="'
+ url + '" style="width:100%;height:100%;"></iframe>';
$('#tabs').tabs('add', {
title: subtitle,
content: content,
closable: true,
//width: $('#index_content').width() - 10,
//height: $('#index_content').height() - 26,
});
}
}
</script>
</head>
<body style="margin: 0px; padding: 0px; overflow: hidden;">
<div class="easyui-layout" style="width: 100%; height: 850px; position: absolute; ">
<div data-options="region:'north'" style="height: 80px"></div>
<div data-options="region:'south',split:true" style="height: 50px;"></div>
<div data-options="region:'west',split:true" title="West" style="width: 200px;">
<div class="easyui-accordion" style="width: auto;">
<ul id="NavTree" class="easyui-tree" data-options="url:'Home/GetMenuNavigations'">
</ul>
</div>
</div>
<div id="tabs" class="easyui-tabs" data-options="region:'center'" ">
<div title="tab1" style="width: 100%">
<h2 style="color:blue ">Welcome to ProductManage System !</h2>
</div>
</div>
</div>
</body>
</html>

浙公网安备 33010602011771号