<P>我在页面上放了一个girdview和两个dropdownlist用来绑定数据,一个是主题一个是新闻,现在要把新闻加到主题下,但新闻太多要分类显示,问题来了,全部新闻有5页,但某一分类的页面也有多页,我用girdview自带的分页功能,分类页的第一页能显示,但第二页就变成全部新闻的第二页,两个dropdownlist都加到if (!Page.IsPostBack)下了可还是有问题,希望有高手可以指点下,在线等,谢了!!!!!</P>
问题补充:
protected void Page_Load(object sender, EventArgs e)
{
if (!Page.IsPostBack)
{
GetDdlDate();
}
GetGdvArticleDate();
}
protected void gdvThemeSubclass_PageIndexChanging(object sender, GridViewPageEventArgs e)
{
gdvThemeSubclass.PageIndex = e.NewPageIndex;
gdvThemeSubclass.DataBind();
}
private void GetThemeDate()
{
Mts.TID = Convert.ToInt32(ddlTheme.SelectedValue);
gdvThemeSubclass.DataSource = Bts.GetNewArticleConcernByTID(Mts);
gdvThemeSubclass.DataBind();
}
private void GetGdvArticleDate()
{
gdvThemeSubclass.DataSource = Bae.GetNewArticle();
gdvThemeSubclass.DataBind();
}
private void GetDdlDate()
{
ddlTheme.DataSource = Bat.GetNewArticleTheme();
ddlTheme.DataTextField= "Title";
ddlTheme.DataValueField="TID" ;
ddlTheme.DataBind();
ddlArticle.DataSource = Bac.GetNewsArticleClass();
ddlArticle.DataTextField = "ClassName";
ddlArticle.DataValueField = "ID";
ddlArticle.DataBind();
}
protected void btnArticleAll_Click(object sender, EventArgs e)
{
gdvThemeSubclass.DataSource = Bae.GetNewArticle();
gdvThemeSubclass.DataBind();
}
protected void btnArticle_Click(object sender, EventArgs e)
{
Mae.ClassID = ddlArticle.SelectedValue;
gdvThemeSubclass.DataSource = Bae.GetNewArticleByClassID(Mae);
gdvThemeSubclass.DataBind();
}