码迷,mamicode.com
首页 > Web开发 > 详细

ASP.NET - 页面传值 Request.QuerString[].ToString();

时间:2015-07-08 14:30:10      阅读:130      评论:0      收藏:0      [点我收藏+]

标签:

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

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!