在gridView中使用Jquery进行验证 [英] Validation using the Jquery in gridView
本文介绍了在gridView中使用Jquery进行验证的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我有一个网格视图,其中在insertitemtemplate里面有一个标签.现在我要
使用Jquery在插入和更新模式下进行验证.
请回答
I have a grid view in which inside a insertitemtemplate i have a label. Now i want
to put the validation during the insert and update mode using the Jquery .
Please answer
推荐答案
在这里,我使用了一些javascript函数来在任何数据控件中单独引发
Hi,
Here I used some javascript function to raise individually in any data control
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
<script src="Scripts/jquery-1.4.1-vsdoc.js" type="text/javascript"></script>
<script src="Scripts/jquery-1.4.1.js" type="text/javascript"></script>
<script language ="javascript" >
function f1(tid) {
document.getElementById(tid).innerText = "hi this is testing";
}
</script>
</head>
<body >
<form id="form1" runat="server">
<div>
<asp:datalist id="DataList1" runat="server" xmlns:asp="#unknown">
<HeaderTemplate > <table>
</HeaderTemplate>
<itemtemplate>
<tr>
<td>
<asp:textbox id="TextBox1" runat="server" onclick="f1(this.id)"></asp:textbox>
</td>
</tr>
</itemtemplate>
<footertemplate>
</footertemplate></table>
</asp:datalist>
</div>
</form>
</body>
</html>
文件后面的代码包含以下代码
And the code behind file contains following code
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
List<string> g = new List<string>();
g.Add("hjghj");
g.Add("hjghj");
g.Add("hjghj");
g.Add("hjghj");
g.Add("hjghj");
g.Add("hjghj");
g.Add("hjghj");
DataList1.DataSource = g;
DataList1.DataBind();
}
}
</string></string>
您也可以将Jquery用于大型操作
我希望你能理解我说的话
最好的
You can use Jquery also for large operations
I hope you understood What I said
All the Best
这篇关于在gridView中使用Jquery进行验证的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文