private void Page_Load(object sender, System.EventArgs e)
        {
            idModulo = Int32.Parse(Request.Params["mid"]);

            if (Page.IsPostBack == false)
            {
                // Obtain a single row of text information

                IDataReader dr = HtmlBD.Obtener(idModulo);

                string Estilo = "~/Temas/" + Global.ObtenerTemaPortal() + "/Estilo.css";

                Texto.DesignModeCss = Texto.HtmlModeCss = Texto.DropDownListCssClass = Estilo;

                if (dr.Read())
                {
                    Texto.Text = Server.HtmlDecode((string)dr["TextoHtml"]);
                }
                else
                {
                    Texto.Text = "Agregue aqui el contenido...";
                }

                dr.Close();

                // Store URL Referrer to return to portal
                ViewState["UrlAnterior"] = Request.UrlReferrer.ToString();
            }
        }
Ejemplo n.º 2
0
        private void Page_Load(object sender, System.EventArgs e)
        {
            IDataReader dr = HtmlBD.Obtener(ModuloId);

            if (dr.Read())
            {
                string contenido = Server.HtmlDecode((string)dr["TextoHtml"]);
                MuestraHtml.Controls.Add(new LiteralControl(contenido));
            }

            dr.Close();
        }
Ejemplo n.º 3
0
        public static void Actualizar(int moduloId, string TextoHtml)
        {
            string Sentencia = string.Empty;

            IDataReader Datos = HtmlBD.Obtener(moduloId);

            if (Datos.Read())
            {
                Sentencia  = "UPDATE htmltexto SET ";
                Sentencia += "TextoHtml = '" + Regex.Replace(TextoHtml, "'", "''") + "' ";
                Sentencia += "WHERE ModuloId = " + moduloId;
            }
            else
            {
                Sentencia  = "INSERT INTO htmltexto (ModuloID, TextoHtml) ";
                Sentencia += "VALUES (" + moduloId + ", ";
                Sentencia += "'" + Regex.Replace(TextoHtml, "'", "''") + "')";
            }

            Datos.Close();

            AyudanteMySQL.Ejecutar(ConfigurationSettings.AppSettings["CadenaConexion"], Sentencia);
        }
 private void botonActualiza_Click(object sender, System.EventArgs e)
 {
     HtmlBD.Actualizar(idModulo, Server.HtmlEncode(Texto.Text));
     Response.Redirect((string)ViewState["UrlAnterior"]);
 }