Beispiel #1
0
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!System.Web.HttpContext.Current.User.Identity.IsAuthenticated || !System.Web.HttpContext.Current.User.IsInRole("NOTICIA"))
            {
                Response.Redirect("~/Default.aspx");
            }

            Int64 idNoticia = Convert.ToInt64(HttpUtility.HtmlDecode(Request.QueryString["IdNoticia"]));

            if (!IsPostBack)
            {
                if (idNoticia > 0)
                {
                    Noticia noticia = new Noticia();
                    noticia.CarregaNoticia(idNoticia);

                    if (noticia.IdNoticia == 0)
                    {
                        Response.Redirect("~/Default.aspx");
                    }

                    TextBoxNoticia.Text = noticia.TextoNoticia;
                    TextBoxLink.Text    = noticia.LinkNoticia;
                }
            }
        }