在asp.net中只有一个验证公平而不是gridview中的多行
问题描述:
嗨......朋友......
i ma使用这个JQuery。
并使用Textbox调用gridview templetfiled。
Hi...friend ...
i ma using this JQuery.
and Call to gridview templetfiled using Textbox.
$(function () {
$("[id*=grvExam]").each(function (e) {
$("[id*=grvExam]input[type=text][id*=txtMark]").keydown(function (e) {
if (e.shiftKey || e.ctrlKey || e.altKey) {
e.preventDefault();
} else {
var key = e.keyCode;
if (!((key == 8) || (key == 46) || (key >= 35 && key <= 40) || (key >= 48 && key <= 57) || (key >= 96 && key <= 105) || (key >= 65 && key <= 66))) {
e.preventDefault();
}
}
})
})
})
Gridview ...
Gridview...
<asp:GridView ID="grvExam" runat="server" AutoGenerateColumns="False" CellPadding="0"
CssClass="GridViewStyle" Width="70%" AllowPaging="True" PageSize="50">
<pagersettings mode="NextPreviousFirstLast" firstpagetext=" First |" lastpagetext=" Last |">
NextPageText=" Next |" PreviousPageText=" Prev |" />
<pagerstyle horizontalalign="Center" />
<footerstyle backcolor="White" forecolor="#000066" />
<rowstyle cssclass="GridViewRowStyle" />
<columns>
<asp:TemplateField HeaderText="Mark">
<itemtemplate>
<asp:TextBox ID="txtMark" runat="server" Width="40%" AutoPostBack="true" Text='<%# bind("Exam_OutMark") %>'
Style="text-transform: uppercase;" OnTextChanged="txtMark_TextChanged">
</itemtemplate>
<itemstyle width="15%" horizontalalign="Left" />
<asp:TemplateField HeaderText="ER No">
<itemtemplate>
<asp:Label ID="lbl_ER" runat="server" Text='<%# bind("Student_Rollno") %>'>
</itemtemplate>
<itemstyle width="10%" horizontalalign="Left" />
</columns>
<emptydatatemplate>
<div class="EmptyRowStyle">
No Record Found.</div>
</emptydatatemplate>
<SelectedRowStyle CssClass="GridViewSelectedRowStyle" />
<HeaderStyle CssClass="GridViewHeaderStyle" />
文本框验证不公平...
请帮帮我...
Textbox validtion Not fair...
please help me...
答
(function(){
(function () {
( [id * = grvExam])。each(function(e){
("[id*=grvExam]").each(function (e) {
( [id * = grvExam] input [type = text] [id * = txtMark]).keydown(function(e){
if (e.shiftKey || e.ctrlKey || e.altKey){
e.preventDefault();
} else {
var key = e .keyCode;
if (!((key == 8 )||(key = = 46 )||(key > = 35 && key < = 40 )|| (键> = 48 && key < ; = 57 )|| (键> = 96 && key < ; = 105 )|| (键> = 65 && key < ; = 66 ))){
e.preventDefault();
}
}
})
})
})
("[id*=grvExam]input[type=text][id*=txtMark]").keydown(function (e) { if (e.shiftKey || e.ctrlKey || e.altKey) { e.preventDefault(); } else { var key = e.keyCode; if (!((key == 8) || (key == 46) || (key >= 35 && key <= 40) || (key >= 48 && key <= 57) || (key >= 96 && key <= 105) || (key >= 65 && key <= 66))) { e.preventDefault(); } } }) }) })
Gridview ...
Gridview...
<asp:GridView ID="grvExam" runat="server" AutoGenerateColumns="False" CellPadding="0"
CssClass="GridViewStyle" Width="70%" AllowPaging="True" PageSize="50">
<pagersettings mode="NextPreviousFirstLast" firstpagetext=" First |" lastpagetext=" Last |">
NextPageText=" Next |" PreviousPageText=" Prev |" />
<pagerstyle horizontalalign="Center" />
<footerstyle backcolor="White" forecolor="#000066" />
<rowstyle cssclass="GridViewRowStyle" />
<columns>
<asp:TemplateField HeaderText="Mark">
<itemtemplate>
<asp:TextBox ID="txtMark" runat="server" Width="40%" AutoPostBack="true" Text='<%# bind("Exam_OutMark") %>'
Style="text-transform: uppercase;" OnTextChanged="txtMark_TextChanged">
</itemtemplate>
<itemstyle width="15%" horizontalalign="Left" />
<asp:TemplateField HeaderText="ER No">
<itemtemplate>
<asp:Label ID="lbl_ER" runat="server" Text='<%# bind("Student_Rollno") %>'>
</itemtemplate>
<itemstyle width="10%" horizontalalign="Left" />
</columns>
<emptydatatemplate>
<div class="EmptyRowStyle">
No Record Found.</div>
</emptydatatemplate>
<SelectedRowStyle CssClass="GridViewSelectedRowStyle" />
<HeaderStyle CssClass="GridViewHeaderStyle" />
文本框验证不公平...
请帮帮我......
Textbox validtion Not fair...
please help me...