How can I access the IDs that are inside a GridView?

1

Example:

I want to get the value that was typed inside this TextBox and as soon as I trigger the event of the bthResposta button I can retrieve it to be able to set the properties of the class ./

Obs. To access this field, I click on a button on the grid that opens a popup

<asp:TextBoxID="txtComentario" runat="server" MaxLength="40" Width="800px"  MinLenght="15" Rows="5" TextMode="MultiLine"></asp:TextBox>

Event

protected void BtnResposta_Click(object sender, EventArgs e)
    {
        try
        {
            if (objWebItens.OcIOcorrencia > 0)
            {

                WebOcorrItens objItens = new WebOcorrItens();
                objItens.OcIOcorrencia = objWebItens.OcIOcorrencia;
                objItens.OcIAcao = "C";
                objItens.OcIDescr = // valor digitado no TextBox
                objItens.OcIDtCad = Convert.ToString(DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"));
                objItens.OcIIdInc = (string)Session["login"];
                objItens.OcIDtInc = Convert.ToString(DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"));
                objItens.OcIArea = objWebItens.OcIArea;
                objItens.InserirDados();
               if(objWebItens.ConsultarOcorrenciaItens(Convert.ToString(objWebItens.OcIOcorrencia)) > 0)
                {
                    WebOcorrencias webOcorrencias = new WebOcorrencias();
                    if (webOcorrencias.ConsultarOcorrencia(objItens.OcIOcorrencia.ToString()) > 0)
                    {
                        webOcorrencias.OcIdAlt = (string)Session["login"];
                        webOcorrencias.OcDtAlt = Convert.ToString(DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss"));
                        //webOcorrencias.AlterarOcorrencia();
                    }

                    EnviarEmailChamado(objItens, "Resposta do Chamanto Nº " + objItens.OcIOcorrencia + "");
                }

            }
        }
        catch (Exception ex)
        {

            throw ex;
        }
    }
    
asked by anonymous 14.05.2018 / 18:25

0 answers