I have an ASP.Net 4.5.1 page written in C# that has a number of TextBoxes on it. When the text in any of the TextBoxes changes, I want to call a method that 1) enables the Save button and b) moves the focus to the TextBox with the next TabIndex after the TextBox that triggered the PostBack. Here's my code so far:
protected void EnableSaveButton(object sender, EventArgs e)
{
if ((REQUEST_PHASE)this.CurrentPhaseID == REQUEST_PHASE.RECORDS)
{
btnSaveACProperty.Disabled = false;
Control control = (Control)sender;
int tabindex = 0;
if (control != null)
{
}
}
}
What I want to do is get the TabIndex of control and then find the control with TabIndex + 1 and do a SetFocus() on it. My problem is that the control variable in my code doesn't have a property of TabIndex. How do I do this?