我在下面textbox
有.itemtemplate of gridview.
问题是当我点击时edit button of gridview
,如果我textbox
根据验证逻辑输入无效值,focus of textbox is lost
当我点击update button
..如果我在第 30 行焦点转到最上面的行..如何防止焦点..
<asp:TextBox ID="tbattendence" Width="40px" runat="Server" Text='<%# Eval("attendence") %>' onkeydown = "return (event.keyCode!=13);">
</asp:TextBox>
</td>
<td>
<asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server" ControlToValidate="tbattendence"
ErrorMessage="Attended Attendence is required!" Display="Dynamic" ValidationGroup="bottom"
ForeColor="#6600FF">*</asp:RequiredFieldValidator>
<asp:CompareValidator ID="CompareValidator" runat="server" ErrorMessage="Attended Attendence must be Lesser!"
ControlToValidate="tbattendence" ControlToCompare="tbcutoff"
Display="Dynamic" Operator="LessThanEqual" Type="Integer" ValidationGroup="bottom">*</asp:CompareValidator>