1
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 stop at another part of the code I run that event?
I just want to avoid it:
if (rdbGarantiaConfissao.SelectedValue == "1")
wucCadastroConfissaoDividaPV.Visible = true;
else
wucGarantiaAdicionalPV.Visible = true;
Because the Selectedindexchanged event already does so, as can be seen.
What other part of the code? Be specific.
– Maniero
Call the method the way you do with any other. Pass one
RadioButtonList
. The parameterEventArgs
may be null.– ramaral
I want to call the Selectedindex of my Radiobuttolist, another method.
– pnet
Within this same class? You need to know exactly who will call you to call the right way (and see if you can call).
– Maniero
The Sender is your
Radiobuttolist
– ramaral
But who is the
Radiobuttolist
? If the method is protected you can only call within this class or one that inherits from this.– Maniero
be more specific, where you want to call this method, this Radiobuttolist has onchange method ?
– Luciano Azevedo
@pnet, the call will be made from the same Class (Page or Usercontrol) or from another Page or Usercontrol?
– Tobias Mesquita
@bigown in this case the
Radiobuttolist
isthis
– ramaral
@That’s what I think but I’m not sure.
– Maniero
Everything is in the same class.
– pnet