linq query webcontrol.controls
i have 3 textbox controls page
<asp:textbox id="textbox1" runat="server" autopostback="true"
ontextchanged="textbox_textchanged" tabindex="1">
<asp:textbox id="textbox2" runat="server" autopostback="true"
ontextchanged="textbox_textchanged" tabindex="2">
<asp:textbox id="textbox3" runat="server" autopostback="true"
ontextchanged="textbox_textchanged" tabindex="3">
and an eventuality handler
protected vacant textbox_textchanged(object sender, eventargs e)
{
webcontrol changed_control = (webcontrol)sender;
var next_controls = webcontrol control changed_control.parent.controls
where control.tabindex > changed_control.tabindex
orderby control.tabindex
name control;
next_controls.defaultifempty(changed_control).first().focus();
}
the definition formula automatically name textbox unbroken tabindex after page post behind (see ). existence i accept invalidcastexception since it's dilettante ban system.web.ui.literalcontrol (webcontrol.controls contains indeed literalcontrols) system.web.ui.webcontrols.webcontrol.
i am prying illusory cgange aproach somehow accept operative solution? conclude you!
Comments
Post a Comment