//Evento al precionar el botón 'Agregar Hashtag' protected void btnAgregarHashtag_Click(object sender, EventArgs e) { string hashtag = txtHashtag.Text; lblRestriccionHashtag.Visible = false; lblExitoHashtag.Visible = false; //Verifica que no se encuentre vacío el textbox if (hashtag != "") { //Verifica si el primer caracter corresponde un # if ((hashtag.Substring(0, 1)) == "#" && !(hashtag.Contains(" "))) { //Solicita al usuario HttpCookie cookie = Request.Cookies["UserInfo"]; if (cookie != null) { denuncia.idUsuario = Int32.Parse(cookie["idUsuario"]); } denuncia.hashtag = hashtag; //Asigna el hashtag denuncia.registroHashtag(); txtHashtag.Text = ""; //Se limpia el textBox lblExitoHashtag.Visible = true; } else { lblRestriccionHashtag.Visible = true; } } else { lblRestriccionHashtag.Visible = true; } }