protected void Page_Load(object sender, EventArgs e) { //Si no autentificado redirecciona a Login if (!this.Page.User.Identity.IsAuthenticated) { FormsAuthentication.RedirectToLoginPage(); } LogicaNegocio.Content objContenidoLN = new LogicaNegocio.Content(); //-------------Inicio Paginador UscPaginador.caragaPaginador(20, Convert.ToInt32(Request.Params["pagina"]), objContenidoLN.countRowsContent(1)); //---------------Fin Paginador List <ModeloNegocio.Content> lista = new List <ModeloNegocio.Content>(); lista = objContenidoLN.getAllContent(20, UscPaginador.RegistrosAEmpezar, 1); foreach (ModeloNegocio.Content Content in lista) { String contenidoNota; String tituloNota; String imagen = ""; //ContenidoNota = Presentacion.App_Code.Global.RemoveHTMLTags("holaa"); // .RemoveHTMLTags(Content.ContentNote); contenidoNota = LogicaNegocio.GlobalFunction.RemoveHTMLTags(Content.ContentNote).Substring(0, 160); if (Content.Title.Length > 86) { tituloNota = LogicaNegocio.GlobalFunction.RemoveHTMLTags(Content.Title).Substring(0, 85); } else { tituloNota = LogicaNegocio.GlobalFunction.RemoveHTMLTags(Content.Title); } if (!string.IsNullOrEmpty(Content.Image)) { imagen = "<img class=\"img-responsive\" src=\"http://contigoentusfinanzasenaula.com/media/images/" + Content.Image + " \" />"; } lblNoticia.Text += "<div class=\"col-md-6\">"; lblNoticia.Text += "<div class=\"nota\">"; lblNoticia.Text += "<div class=\"caption\">"; lblNoticia.Text += "<h4>" + tituloNota + "...</h4>"; lblNoticia.Text += imagen; lblNoticia.Text += "<p><a href=\"noticia-detalle.aspx?id=" + Content.Id + " \">" + contenidoNota + "...</a></p>"; lblNoticia.Text += " <p><a href=\"noticia-detalle.aspx?id=" + Content.Id + "\" class=\"btn btn-default btn-xs\" role=\"button\">Leer más</a>"; lblNoticia.Text += " </div>"; lblNoticia.Text += " </div>"; lblNoticia.Text += "</div>"; } }
protected void Page_Load(object sender, EventArgs e) { //Si no autentificado redirecciona a Login if (!this.Page.User.Identity.IsAuthenticated) { FormsAuthentication.RedirectToLoginPage(); } LogicaNegocio.Content objContenidoLN = new LogicaNegocio.Content(); //-------------Inicio Paginador UscPaginador.caragaPaginador(20, Convert.ToInt32(Request.Params["pagina"]), objContenidoLN.countRowsContent(1)); //---------------Fin Paginador List<ModeloNegocio.Content> lista = new List<ModeloNegocio.Content>(); lista = objContenidoLN.getAllContent(20, UscPaginador.RegistrosAEmpezar, 1); foreach (ModeloNegocio.Content Content in lista) { String contenidoNota; String tituloNota; String imagen=""; //ContenidoNota = Presentacion.App_Code.Global.RemoveHTMLTags("holaa"); // .RemoveHTMLTags(Content.ContentNote); contenidoNota = LogicaNegocio.GlobalFunction.RemoveHTMLTags(Content.ContentNote).Substring(0, 160); if (Content.Title.Length > 86) { tituloNota = LogicaNegocio.GlobalFunction.RemoveHTMLTags(Content.Title).Substring(0, 85); } else { tituloNota = LogicaNegocio.GlobalFunction.RemoveHTMLTags(Content.Title); } if (!string.IsNullOrEmpty(Content.Image)) { imagen = "<img class=\"img-responsive\" src=\"http://contigoentusfinanzasenaula.com/media/images/" + Content.Image + " \" />"; } lblNoticia.Text += "<div class=\"col-md-6\">" ; lblNoticia.Text += "<div class=\"nota\">"; lblNoticia.Text += "<div class=\"caption\">"; lblNoticia.Text += "<h4>" + tituloNota + "...</h4>"; lblNoticia.Text += imagen; lblNoticia.Text += "<p><a href=\"noticia-detalle.aspx?id=" + Content.Id + " \">" + contenidoNota + "...</a></p>"; lblNoticia.Text += " <p><a href=\"noticia-detalle.aspx?id=" + Content.Id + "\" class=\"btn btn-default btn-xs\" role=\"button\">Leer más</a>"; lblNoticia.Text += " </div>"; lblNoticia.Text += " </div>"; lblNoticia.Text += "</div>"; } }
// private ModeloNegocio.Comment objCommentMN; protected void Page_Load(object sender, EventArgs e) { //Si no autentificado redirecciona a Login if (!this.Page.User.Identity.IsAuthenticated) { FormsAuthentication.RedirectToLoginPage(); } if (!IsPostBack) { if (!string.IsNullOrEmpty(Request.Params["id"])) { id = Convert.ToInt32(Request.Params["id"]); objContentMN = new ModeloNegocio.Content(); objContentLN = new LogicaNegocio.Content(); objContentMN = objContentLN.getContentId(id); objCommentMN = new ModeloNegocio.Comment(); string imagen = ""; if (!string.IsNullOrEmpty(objContentMN.Image)) { imagen = "<img class=\"img-responsive\" src=\"http://contigoentusfinanzasenaula.com/media/images/" + objContentMN.Image + " \" />"; } lblDetalleNoticia.Text += "<h1>" + objContentMN.Title + "</h1>"; lblDetalleNoticia.Text += imagen; lblDetalleNoticia.Text += objContentMN.ContentNote; List <ModeloNegocio.Comment> lista = objContentMN.Comment; if (lista.Count > 0) { foreach (ModeloNegocio.Comment comment in lista) { lblComentario.Text += "<blockquote>"; lblComentario.Text += "<h4>Correo: " + comment.EmailAuthor + " <small>Fecha: " + comment.Created_at + "</small></h4>"; lblComentario.Text += "<p>" + comment.CommentContent + "</p>"; lblComentario.Text += "</blockquote>"; } } } } }
// private ModeloNegocio.Comment objCommentMN; protected void Page_Load(object sender, EventArgs e) { //Si no autentificado redirecciona a Login if (!this.Page.User.Identity.IsAuthenticated) { FormsAuthentication.RedirectToLoginPage(); } if (!IsPostBack) { if (!string.IsNullOrEmpty(Request.Params["id"])) { id= Convert.ToInt32(Request.Params["id"]); objContentMN = new ModeloNegocio.Content(); objContentLN = new LogicaNegocio.Content(); objContentMN = objContentLN.getContentId(id); objCommentMN = new ModeloNegocio.Comment(); string imagen = ""; if (!string.IsNullOrEmpty(objContentMN.Image)) { imagen = "<img class=\"img-responsive\" src=\"http://contigoentusfinanzasenaula.com/media/images/" + objContentMN.Image + " \" />"; } lblDetalleNoticia.Text += "<h1>" + objContentMN.Title + "</h1>"; lblDetalleNoticia.Text += imagen ; lblDetalleNoticia.Text += objContentMN.ContentNote ; List<ModeloNegocio.Comment> lista = objContentMN.Comment; if (lista.Count > 0) { foreach (ModeloNegocio.Comment comment in lista) { lblComentario.Text += "<blockquote>"; lblComentario.Text += "<h4>Correo: " + comment.EmailAuthor + " <small>Fecha: " + comment.Created_at + "</small></h4>"; lblComentario.Text += "<p>" + comment.CommentContent + "</p>"; lblComentario.Text += "</blockquote>"; } } } } }
protected void Page_Load(object sender, EventArgs e) { LogicaNegocio.Content objContenidoLN = new LogicaNegocio.Content(); List <ModeloNegocio.Content> lista = new List <ModeloNegocio.Content>(); lista = objContenidoLN.getAllContent(4, 0, 1); foreach (ModeloNegocio.Content Content in lista) { String contenidoNota; String tituloNota; String imagen = ""; //ContenidoNota = Presentacion.App_Code.Global.RemoveHTMLTags("holaa"); // .RemoveHTMLTags(Content.ContentNote); contenidoNota = LogicaNegocio.GlobalFunction.RemoveHTMLTags(Content.ContentNote).Substring(0, 160); if (Content.Title.Length > 86) { tituloNota = LogicaNegocio.GlobalFunction.RemoveHTMLTags(Content.Title).Substring(0, 85); } else { tituloNota = LogicaNegocio.GlobalFunction.RemoveHTMLTags(Content.Title); } if (!string.IsNullOrEmpty(Content.Image)) { imagen = "<img class=\"img-responsive\" src=\"http://contigoentusfinanzasenaula.com/media/images/" + Content.Image + " \" />"; } //<h1>titulo</h1> // <p>Lorem ipsum dolor sit amet, consectetur adipisicing elit. Modi nihil quos saepe ut. cum exercitationem illo nesciunt quos!</p> // lblNoticia.Text += "<div class=\"col-md-6\">"; // lblNoticia.Text += "<div class=\"nota\">"; // lblNoticia.Text += "<div class=\"caption\">"; lblNoticia.Text += "<h6>" + CultureInfo.CurrentCulture.TextInfo.ToTitleCase(tituloNota.ToLower()) + "...</h6>"; //lblNoticia.Text += imagen; // lblNoticia.Text += "<p><a href=\"noticia-detalle.aspx?id=" + Content.Id + " \">" + contenidoNota + "...</a></p>"; lblNoticia.Text += " <p><a href=\"noticia-detalle.aspx?id=" + Content.Id + "\" class=\"btn btn-default btn-xs\" role=\"button\">Leer más</a>"; // lblNoticia.Text += " </div>"; // lblNoticia.Text += " </div>"; // lblNoticia.Text += "</div>"; } }