Olá pessoal, estou precisando da ajuda de vocês.
Tenho uma página asp.net(webforms) com os seguintes controles:
1 TabContainer e 4 TabPanel
Quote:
Hi guys, I need your help.
I have an asp.net(webforms) page with the following controls:
1 TabContainer and 4 TabPanel
Dentro do primeiro TabPanel1 tenho um controle do tipo Edit1.text, quando digito algo dentro dele tento estabelecer o focus no Edit2, mas não esta dando certo, vou deixar aqui minhas tentativas
Quote:
Inside the first TabPanel1 I have a control of type Edit1.text, when I type something inside it I try to establish the focus on Edit2, but it's not working, I'll leave my attempts here
TextBox MyTextBox = (TextBox)((TextBox)sender).FindControl("Edit2");
MyTextBox.Text = "Hello";
MyTextBox.Focus();
Obs:O texto "Hello" funciona mas o Focus() não funciona
Quote:
Note: The text "Hello" works but Focus() does not
//Já tentei
//I tried
TabContainer tb = ((TabContainer)this.TabContainer1.FindControl("TabContainer1"));
TabPanel tp = ((TabPanel)tb.FindControl("TabPanel1"));
((TextBox)tp.FindControl("Edit2")).Text = "TesteFocus";
((TextBox)tp.FindControl("Edit2")).Focus();
Tentei algumas funções JS mas sem sucesso.
Alguém já passou por isso?
Poderia ajudar?
Quote:
I tried some JS functions but without success.
Has anyone ever experienced this?
Could help?
What I have tried:
<pre lang="C#">TextBox MyTextBox = (TextBox)((TextBox)sender).FindControl("Edit2");
MyTextBox.Text = "Hello";
MyTextBox.Focus();
Obs:O texto "Hello" funciona mas o Focus() não funciona
<pre lang="C#">TabContainer tb = ((TabContainer)this.TabContainer1.FindControl("TabContainer1"));
TabPanel tp = ((TabPanel)tb.FindControl("TabPanel1"));
((TextBox)tp.FindControl("Edit2")).Text = "TesteFocus";
((TextBox)tp.FindControl("Edit2")).Focus();