protected void Page_Load(object sender, EventArgs e) { string username = Page.User.Identity.Name; if (Roles.IsUserInRole(username, "Adminstrator")) { adminpanel.Visible = true; } if (Roles.IsUserInRole(username, "FreeUsers")) { adminpanel.Visible = false; } newsflash_GetDescriptionTableAdapter news = new newsflash_GetDescriptionTableAdapter(); dlNewsFlash.DataSource= news.GetDatanewsflash(); dlNewsFlash.DataBind(); }
protected void updatenewsflash(object sender, EventArgs e) { newsflash_GetallTableAdapter dtgetall = new newsflash_GetallTableAdapter(); dtgetall.Update(ddlyear.SelectedValue, ddlmonth.SelectedValue, Editor1.Content); newsflash_GetDescriptionTableAdapter descr = new newsflash_GetDescriptionTableAdapter(); DataTable dtgetupdate = descr.GetDatanewsflash(); Label lblnewsflash = (Label)FindControlRecursive(Page, "lblnewsflash"); if (dtgetupdate.Rows.Count > 0) { string desc = dtgetupdate.Rows[0]["Newsflash"].ToString(); lblnewsflash.Text = desc; } }