I have this event in my code:
protected void rdbGarantiaConfissao_SelectedIndexChanged(object sender, EventArgs e)
{
//Declarações
RadioButtonList vrblAprovado = sender as RadioButtonList;
try
{
//Instâncias e Inicializações
//Desenvolvimento
if (vrblAprovado.SelectedValue == "1")
MostraConfissaoGarantia(1);
else
MostraConfissaoGarantia(2);
}
catch (Exception Ex)
{
Mensagem = (wucMensagens)Page.Master.FindControl("wucMasterMensagens");
Mensagem.ExibirMensagem(wucMensagens.TipoAlerta.Erro, Ex.Source, Ex.Message, Ex.StackTrace);
}
}
How do I in another part of the code I run this event?
I just want to avoid this:
if (rdbGarantiaConfissao.SelectedValue == "1")
wucCadastroConfissaoDividaPV.Visible = true;
else
wucGarantiaAdicionalPV.Visible = true;
Because the SelectedIndexChanged event already does this, as can be seen.