-------------------------------------
源代码下载/Files/singlepine/topmenu.rar
public class TopMenu : System.Web.UI.Page
{
protected DataRow[] father;
protected DataRow[] first;
protected DataRow[] second;
private void Page_Load(object sender, System.EventArgs e)
{
}
public static string ConnectionString=System.Configuration .ConfigurationSettings .AppSettings["ConnectionString"];
GetDataSet
Web Form Designer generated code
LoadTopMenu
}
{
protected DataRow[] father;
protected DataRow[] first;
protected DataRow[] second;
private void Page_Load(object sender, System.EventArgs e)
{
}
public static string ConnectionString=System.Configuration .ConfigurationSettings .AppSettings["ConnectionString"];
GetDataSet
Web Form Designer generated code
LoadTopMenu
}
3.数据库脚本
--建表
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[topmenu]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[topmenu]
GO
CREATE TABLE [dbo].[topmenu] (
[ID] [int] NOT NULL ,
[parentId] [int] NOT NULL ,
[text] [nvarchar] (255) COLLATE Chinese_PRC_CI_AS NULL ,
[url] [nvarchar] (255) COLLATE Chinese_PRC_CI_AS NULL ,
[target] [nvarchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
[IsBoot] [int] NULL ,
[visible] [nvarchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
[status] [nvarchar] (50) COLLATE Chinese_PRC_CI_AS NULL
) ON [PRIMARY]
GO
--插入测试数据
insert into topmenu([ID],[parentId],[text],[url],[target],[IsBoot],[visible] ,[status])
values(1,0,'深圳','http://singlepine.cnblogs.com/articles/259955.html','self',0,'false','深圳')
insert into topmenu([ID],[parentId],[text],[url],[target],[IsBoot],[visible] ,[status])
values(2,1,'南山','http://singlepine.cnblogs.com/articles/259955.html','self',1,'false','南山')
insert into topmenu([ID],[parentId],[text],[url],[target],[IsBoot],[visible] ,[status])
values(3,1,'福田','http://singlepine.cnblogs.com/articles/259955.html','self',1,'false','福田')
insert into topmenu([ID],[parentId],[text],[url],[target],[IsBoot],[visible] ,[status])
values(4,2,'科技园','http://singlepine.cnblogs.com/articles/259955.html','self',2,'false','科技园')
insert into topmenu([ID],[parentId],[text],[url],[target],[IsBoot],[visible] ,[status])
values(5,3,'塞格','http://singlepine.cnblogs.com/articles/259955.html','self',2,'false','塞格')
insert into topmenu([ID],[parentId],[text],[url],[target],[IsBoot],[visible] ,[status])
values(6,0,'广州','http://singlepine.cnblogs.com/articles/259955.html','self',0,'false','广州')
insert into topmenu([ID],[parentId],[text],[url],[target],[IsBoot],[visible] ,[status])
values(7,6,'广州火车站','http://singlepine.cnblogs.com/articles/259955.html','self',1,'false','广州火车站')
if exists (select * from dbo.sysobjects where id = object_id(N'[dbo].[topmenu]') and OBJECTPROPERTY(id, N'IsUserTable') = 1)
drop table [dbo].[topmenu]
GO
CREATE TABLE [dbo].[topmenu] (
[ID] [int] NOT NULL ,
[parentId] [int] NOT NULL ,
[text] [nvarchar] (255) COLLATE Chinese_PRC_CI_AS NULL ,
[url] [nvarchar] (255) COLLATE Chinese_PRC_CI_AS NULL ,
[target] [nvarchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
[IsBoot] [int] NULL ,
[visible] [nvarchar] (50) COLLATE Chinese_PRC_CI_AS NULL ,
[status] [nvarchar] (50) COLLATE Chinese_PRC_CI_AS NULL
) ON [PRIMARY]
GO
--插入测试数据
insert into topmenu([ID],[parentId],[text],[url],[target],[IsBoot],[visible] ,[status])
values(1,0,'深圳','http://singlepine.cnblogs.com/articles/259955.html','self',0,'false','深圳')
insert into topmenu([ID],[parentId],[text],[url],[target],[IsBoot],[visible] ,[status])
values(2,1,'南山','http://singlepine.cnblogs.com/articles/259955.html','self',1,'false','南山')
insert into topmenu([ID],[parentId],[text],[url],[target],[IsBoot],[visible] ,[status])
values(3,1,'福田','http://singlepine.cnblogs.com/articles/259955.html','self',1,'false','福田')
insert into topmenu([ID],[parentId],[text],[url],[target],[IsBoot],[visible] ,[status])
values(4,2,'科技园','http://singlepine.cnblogs.com/articles/259955.html','self',2,'false','科技园')
insert into topmenu([ID],[parentId],[text],[url],[target],[IsBoot],[visible] ,[status])
values(5,3,'塞格','http://singlepine.cnblogs.com/articles/259955.html','self',2,'false','塞格')
insert into topmenu([ID],[parentId],[text],[url],[target],[IsBoot],[visible] ,[status])
values(6,0,'广州','http://singlepine.cnblogs.com/articles/259955.html','self',0,'false','广州')
insert into topmenu([ID],[parentId],[text],[url],[target],[IsBoot],[visible] ,[status])
values(7,6,'广州火车站','http://singlepine.cnblogs.com/articles/259955.html','self',1,'false','广州火车站')