温馨提示:代码在线浏览功能只能做为源码浏览参考,不能展示项目的全部,如果想更进一步了解该代码请下载:漂亮无限级分类源代码(三层实现)
当前文件路径:JohnTree/JohnTree.Web/Default.aspx

1<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="JohnTree.Web._Default" %> 2
3
<%@ Register Assembly="System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" 4
Namespace="System.Web.UI" TagPrefix="asp" %> 5
6
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 7
8
<html xmlns="http://www.w3.org/1999/xhtml" > 9
<head> 10
<title>无限级分类</title> 11
<style type="text/css"> 12
body, td { font-size:12px;} 13
a { color:#000;} 14
.main_table { width:100%; padding:2px; border:solid 1px #C4D8ED;} 15
.td_title { height:25px; line-height:25px; background:#EEF7FD; color:#135294; font-weight:bold;} 16
.td_on { background:#fafafa;} 17
.td_off { background:#EEF7FD;} 18
</style> 19
<script type="text/javascript"> 20
function ChkInput() 21
{ 22
if(document.getElementById("txtClassName").value=="") 23
{ 24
alert("栏目名称不能为空!"); 25
document.getElementById("txtClassName").focus(); 26
return false; 27
} 28
} 29
</script> 30
</head> 31
<body> 32
<!--download from 51aspx.com(51aspx.com)--> 33
34
<form id="form1" runat="server"> 35
<asp:ScriptManager ID="ScriptManager1" runat="server"></asp:ScriptManager> 36
<asp:UpdatePanel ID="UpdatePanelRpt" runat="server"> 37
<contenttemplate> 38
<div style="font-size:14px; font-weight:bold;"><a href="?ClassKind=1">查看所有栏目</a> Web技术开发交流: QQ群1:20875924, QQ群2:9116399, QQ群3:11741038 http://oego.cn</div> 39
<table cellpadding=0 cellspacing=1 border=0 align="center" width="100%"> 40
<tr> 41
<td> 42
<asp:DropDownList ID="DdlMenu" runat="server" CssClass="select"> 43
<asp:ListItem Value="0" Text="添加为根栏目"></asp:ListItem> 44
</asp:DropDownList> 45
<asp:HiddenField ID="HidClassId" runat="server" /> 46
<asp:TextBox ID="txtClassName" runat="server" Width="200px"></asp:TextBox> 47
<asp:Button ID="btnAdd" runat="server" Text=" 添加 " OnClick="btnAdd_Click" /> 48
<asp:Button ID="btnEdit" runat="server" Text=" 保存 " Visible="false" OnClick="btnEdit_Click" /> 49
</td> 50
</tr> 51
<tr> 52
<td valign="top"> 53
<asp:Repeater ID="rptMenuList" runat="server" OnItemDataBound="rptMenuList_ItemDataBound" OnItemCommand="rptMenuList_ItemCommand"> 54
<HeaderTemplate> 55
<table class="main_table" cellpadding="0" cellspacing="1" border="0" width="100%"> 56
<tr align="center" class="td_title"> 57
<td align="left" width="75%">栏目名称</td> 58
<td align="left" width="10%">栏目顺序</td> 59
<td align="center" width="15%">操作</td> 60
</tr> 61
</HeaderTemplate> 62
<ItemTemplate> 63
<tr class="td_on" onmouseover="this.className='td_off'" onmouseout="this.className='td_on'"> 64
<td> 65
<asp:HiddenField ID="txtClassId" runat="server" Value='<%#DataBinder.Eval(Container.DataItem,"ClassId") %>' /> 66
<asp:Literal ID="LitFirst" runat="server"></asp:Literal><asp:Label ID="LabClassNm" runat="server" Text='<%#DataBinder.Eval(Container.DataItem,"ClassName") %>'></asp:Label> 67
</td> 68
<td> 69
<asp:TextBox Width="50" ID="txtOrder" runat="server" Text='<%#DataBinder.Eval(Container.DataItem,"ClassOrder") %>'></asp:TextBox> 70
</td> 71
<td align="center"><asp:LinkButton ID="BtnEdit" CommandName="BtnEdit" runat="server">编辑</asp:LinkButton> | <asp:LinkButton ID="BtnDelete" CommandName="BtnDelete" runat="server" OnClientClick="return confirm('你确定要删除吗')">删除</asp:LinkButton></td> 72
</tr> 73
</ItemTemplate> 74
<FooterTemplate> 75
</table> 76
</FooterTemplate> 77
</asp:Repeater> 78
</td> 79
</tr> 80
<tr> 81
<td> 82
<asp:Button ID="BtnSave" runat="server" Text=" 保存 " OnClick="BtnSave_Click" /> 83
</td> 84
</tr> 85
</table> 86
</contenttemplate> 87
</asp:UpdatePanel> 88
</form> 89
<a href="http://www.51aspx.com/CV/JohnTree" target="_blank" title="Asp.net源码下载专业站">download from 51aspx.com</a> 90
91
</body> 92
</html>



Namespace
body, td
}