标签:
public partial class WebForm2 : System.Web.UI.Page
{
BLL.CategoryBLL categorybll = new CategoryBLL();
BLL.NewsBLL newsbll = new NewsBLL();
//接收分类ID
string NewsId = string.Empty;
protected void Page_Load(object sender, EventArgs e)
{
//接收分类ID
NewsId = Request.QueryString["id"].ToString();
if (!Page.IsPostBack)
{
datasourcebind();
}
}
public void datasourcebind()
{
//根据类别ID取出新闻
this.rep_allnews.DataSource = newsbll.SelectNewsToCategoryId(NewsId);
this.rep_allnews.DataBind();
}
}
ASP.NET - 页面传值 Request.QuerString[].ToString();
标签:
原文地址:http://www.cnblogs.com/KTblog/p/4629994.html