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>");
}
}
}
}
哪里说明了和生成页面名称有关的啊??????????我怎么找不到啊

解决方案 »

  1.   

    Convert.ToInt32(dt.Rows[i][0].ToString()
    这句是什么意思啊??????
      

  2.   


    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>");
    }
    }
    }
    }
      

  3.   

    Convert.ToInt32(dt.Rows[i][0].ToString())
    强制类型转换,得到一个int型传入CreateClass、CreateItem等构造方法中
      

  4.   

    不是吧?
    你学过C#吗?
    Convert.ToInt32(dt.Rows[i][0].ToString())将DataTable中第i行索引为0的列转换成int。
    生成静态页面的代码和逻辑应该在CreateArticle中。
      

  5.   

    文章表加个生产静态的页面的路径HtmlUrl ,if(HtmlUrl <>'') 前台就放这个Url 否则就是View?ID=