コード例 #1
0
ファイル: news.aspx.cs プロジェクト: koushikpa1/USAdvisory
    protected void gvPageIndexChanging(Object sender, GridViewPageEventArgs e)
    {
        gvNewsAndViews.PageIndex = e.NewPageIndex;
        gvNewsAndViews.DataBind();

        NewsAndViews newsDescription = new NewsAndViews();
        lblArticleDes.Text = GetArticleDescription(newsDescription.GetAllNewsAndViews()[e.NewPageIndex * 10].ArticleId);

        UpdatePanel2.Update();
    }
コード例 #2
0
 protected void Page_Load(object sender, EventArgs e)
 {
     NewsAndViews newsAndViews = new NewsAndViews();
     List<NewsAndViews> listWatchOut = new List<NewsAndViews>();
     listWatchOut = newsAndViews.GetAllNewsAndViews();
     //Remove all other News Wire data above 5 records.
     //TO DO : Try to configure the number of records to display in web.config
     if (listWatchOut.Count > 7)
         listWatchOut.RemoveRange(6, listWatchOut.Count - 7);
     NewsandViewsRepeater.DataSource = listWatchOut;
     NewsandViewsRepeater.DataBind();
 }
コード例 #3
0
ファイル: news.aspx.cs プロジェクト: udayr/USAdvisory
    protected void Page_Load(object sender, EventArgs e)
    {
        NewsAndViews newsAndViews = new NewsAndViews();
        List<NewsAndViews> listNewsAndViews = newsAndViews.GetAllNewsAndViews();
        gvNewsAndViews.DataSource = listNewsAndViews;
        gvNewsAndViews.DataBind();

        NewsAndViews newsDescription = new NewsAndViews();
        newsDescription.ArticleId = 1;
        NewsAndViews newsDescription1 = new NewsAndViews();
        newsDescription1 = newsDescription.GetAllNewsAndViewsById();
        lblArticleDes.Text = newsDescription1.ArticleDesc;
    }
コード例 #4
0
ファイル: news.aspx.cs プロジェクト: karthikxx/USAdvisory
    protected void Page_Load(object sender, EventArgs e)
    {
        if(this.Request.QueryString["SelId"] != null)
        selectedArticleId = this.Request.QueryString["SelId"].ToString();

        NewsAndViews newsAndViews = new NewsAndViews();
        List<NewsAndViews> listNewsAndViews = newsAndViews.GetAllNewsAndViews();
        gvNewsAndViews.DataSource = listNewsAndViews;
        gvNewsAndViews.DataBind();

        NewsAndViews newsDescription = new NewsAndViews();
        if (!string.IsNullOrEmpty(selectedArticleId))
        {
            newsDescription.ArticleId = Convert.ToInt32(selectedArticleId);
        }
        else
        {
            newsDescription.ArticleId = listNewsAndViews[0].ArticleId;
            gvNewsAndViews.Rows[0].BackColor = System.Drawing.Color.LightGray;
        }
        NewsAndViews newsDescription1 = new NewsAndViews();
        newsDescription1 = newsDescription.GetAllNewsAndViewsById();
        lblArticleDes.Text = newsDescription1.ArticleDesc;
    }