ASP.NET中的静态页面生成后,怎么能形成链接关系呢????
用了什么原理呢???
急!!!!!!
现在有这样一段代码:
protected void Button1_Click(object sender, System.EventArgs e)
{
try
{
DataTable dt;
dt=DBQuery.OpenTable("Article");
for(int i=0;i<dt.Rows.Count;i++)
{
using(CreateArticle ca=new CreateArticle(Convert.ToInt32(dt.Rows[i][0].ToString())))
{
ca.Add();
}
}
using(CreateDown cd=new CreateDown())
{
cd.Add();
}
dt=TableQuery.ClassQuery();
for(int i=0;i<dt.Rows.Count;i++)
{
using(CreateClass cc=new CreateClass(Convert.ToInt32(dt.Rows[i][0].ToString())))
{
cc.Add();
}
}
dt=DBQuery.OpenTable("Item");
for(int i=0;i<dt.Rows.Count;i++)
{
using(CreateItem ci=new CreateItem(Convert.ToInt32(dt.Rows[i][0].ToString())))
{
ci.Add();
}
}
using(CreateIndexPage cip=new CreateIndexPage())
{
cip.Add();
}
CreateIntro c=new CreateIntro(new Intro());
c.Add(); Response.Write("<script>alert('生成成功');</script>");
}
catch(Exception ex)
{
Response.Write("<script>alert('"+ex.Message.ToString()+"');</script>");
}
}
}
}
哪里说明了和生成页面名称有关的啊??????????我怎么找不到啊
用了什么原理呢???
急!!!!!!
现在有这样一段代码:
protected void Button1_Click(object sender, System.EventArgs e)
{
try
{
DataTable dt;
dt=DBQuery.OpenTable("Article");
for(int i=0;i<dt.Rows.Count;i++)
{
using(CreateArticle ca=new CreateArticle(Convert.ToInt32(dt.Rows[i][0].ToString())))
{
ca.Add();
}
}
using(CreateDown cd=new CreateDown())
{
cd.Add();
}
dt=TableQuery.ClassQuery();
for(int i=0;i<dt.Rows.Count;i++)
{
using(CreateClass cc=new CreateClass(Convert.ToInt32(dt.Rows[i][0].ToString())))
{
cc.Add();
}
}
dt=DBQuery.OpenTable("Item");
for(int i=0;i<dt.Rows.Count;i++)
{
using(CreateItem ci=new CreateItem(Convert.ToInt32(dt.Rows[i][0].ToString())))
{
ci.Add();
}
}
using(CreateIndexPage cip=new CreateIndexPage())
{
cip.Add();
}
CreateIntro c=new CreateIntro(new Intro());
c.Add(); Response.Write("<script>alert('生成成功');</script>");
}
catch(Exception ex)
{
Response.Write("<script>alert('"+ex.Message.ToString()+"');</script>");
}
}
}
}
哪里说明了和生成页面名称有关的啊??????????我怎么找不到啊
解决方案 »
- 电子签名、加盖印章
- 入力检测中发现错误弹出对话框的问题
- 请教各位,这是什么问题啊?
- Treeview控件的节点打开问题
- ==========vs2005中自带的水晶报表为什么打印时需要上网下载签名?=================
- 前天到一家公司面试,面试官问了我这样一个asp.net题目,该怎样作答呢?
- infragistics控件在asp.net中报错:OBJECT ERROR (不是IE设置的问题)
- asp.net2.0网站,用.net自带treeview控件的网页发布后出错
- 急问大侠,以下语句为什么为出错。是一本教科书上的例子,整本书用的都是这种方法。
- 谁有异步获取数据的实例?
- indexOf()方法使用困惑
- 这样new出来的控件如何换行?
这句是什么意思啊??????
protected void Button1_Click(object sender, System.EventArgs e)
{
try
{
//=====================开始生成文章=======================//
DataTable dt;
dt=DBQuery.OpenTable("Article");
for(int i=0;i<dt.Rows.Count;i++)
{
using(CreateArticle ca=new CreateArticle(Convert.ToInt32(dt.Rows[i][0].ToString())))
{
//=====================在ca.Add()中生成静态页面=======================//
ca.Add();
}
}
//=====================结束生成文章=======================//
using(CreateDown cd=new CreateDown())
{
cd.Add();
}
dt=TableQuery.ClassQuery();
for(int i=0;i<dt.Rows.Count;i++)
{
using(CreateClass cc=new CreateClass(Convert.ToInt32(dt.Rows[i][0].ToString())))
{
cc.Add();
}
}
dt=DBQuery.OpenTable("Item");
for(int i=0;i<dt.Rows.Count;i++)
{
using(CreateItem ci=new CreateItem(Convert.ToInt32(dt.Rows[i][0].ToString())))
{
ci.Add();
}
}
using(CreateIndexPage cip=new CreateIndexPage())
{
cip.Add();
}
CreateIntro c=new CreateIntro(new Intro());
c.Add();Response.Write("<script>alert('生成成功');</script>");
}
catch(Exception ex)
{
Response.Write("<script>alert('"+ex.Message.ToString()+"');</script>");
}
}
}
}
强制类型转换,得到一个int型传入CreateClass、CreateItem等构造方法中
你学过C#吗?
Convert.ToInt32(dt.Rows[i][0].ToString())将DataTable中第i行索引为0的列转换成int。
生成静态页面的代码和逻辑应该在CreateArticle中。