本文介绍了如何在vb.net中的jquery中绑定gridview的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我想在girdview中绑定列而不回发如何从新值中替换旧值
I want to bind column in girdview without postback how should i replace my old value from new value
<asp:GridView id="gridUserData" runat="server" />
<Columns>
<asp:TemplateField HeaderText="User Code" HeaderStyle-Width="110px" SortExpression="USRM_USER_CD" >
<ItemTemplate>
<asp:Label ID="lblRepUserCode" runat="server" Text=''<%#Eval("USRM_USER_CD")%>'' />
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="User Name" SortExpression="USRM_USER_NAME" HeaderStyle-Width="150px">
<ItemTemplate>
<asp:Label ID="lblRepUserName" runat="server" Text=''<%#Eval("USRM_USER_NAME")%>'' />
</ItemTemplate>
</asp:TemplateField>
<asp:TemplateField HeaderText="" HeaderStyle-Width="46px">
<ItemTemplate>
<input type="button" class="DisplayData Edit_Btn" id="<%#Eval("USRM_USER_CD")%>" Text="Edit" title="Edit" />
</ItemTemplate>
</asp:TemplateField>
</Columns>
</asp:GridView>
Public Shared Function GetProducts() As List(Of clsUSRM)
Dim str As String = ""
Dim table As DataTable = clsUSRM.ListData(str)
Dim list As New List(Of clsUSRM)()
For Each row As DataRow In table.Rows
Dim detail As New clsUSRM()
detail.USRM_USER_CD = (row("USRM_USER_CD")).ToString()
detail.USRM_USER_NAME = row("USRM_USER_NAME").ToString()
list.Add(detail)
Next
Return list
End Function
function BindGridView() {
$.ajax({
type: "POST",
url: "User_Create_Update.aspx/GetProducts",
data: "{}",
contentType: "application/json",
dataType: "json",
success: function (data) {
for (var i = 0; i < data.d.length; i++) {
("<tr><td>" + data.d[i].USRM_USER_CD +
"</td><td>" + data.d[i].USRM_USER_NAME + "</td></tr>");
}
}
})
}
推荐答案
这篇关于如何在vb.net中的jquery中绑定gridview的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!