weixin_33705053 2009-03-31 00:50 采纳率: 0%
浏览 38

通过jQuery ajax绑定GridView

I am new to jQuery, trying to populate a GridView or Telerik RadGrid using jQuery. Not sure how to go about it and unable to find any examples. Any help is appreciated. Thanks.

Essentially I am trying to display a modal window with a textbox and button. The user enters a search criteria presses the button and a gridview in the same modal window is populated with the results.

The user than selects records in the grid presses another button and the selected users are inserted into the database table, modal window is closed and a grid on the parent page is refreshed showing the new added users.

<input type="button" id="btnAddNewUserj" value="Add New User" />

$(document).ready(function() {
$("#btnAddNewUserj")
    .click(function() { ShowNewUserDialog(); return false });

$("#btnSearch")
    .click(function() { FindUsers(); return false });
});

function ShowNewUserDialog() {
    $("#newuserDialog").dialog({ modal: true, bgiframe: true }).dialog("open");
}

function FindUsers() {
  // HOW TO DO THIS?
  // Show selectable list of users from the database in grid.
}

<div id="newuserDialog" title="Add New User" style="display:none;">
<div>
<input id="txtSearchFor" type="text" />&nbsp;&nbsp;
<input id="btnSearch" type="button" value="Search" class="Button" /></div>
<p> DISPLAY RESULTS HERE </p>
<div style="margin:10px 6px;">
<input type="button" id="btnjAdd" value="Add" class="Button" />&nbsp;&nbsp;
<input type="button" id="btnjCancel" value="Cancel" class="Button" />   
</div>
</div>
  • 写回答

3条回答 默认 最新

  • YaoRaoLov 2009-03-31 01:57
    关注

    A couple of thoughts here. You cannot populate a GridView or Telerik Grid using jQuery. jQuery is a client side technology and those two grids are server side.

    You can use jQuery to hit a web service and build out and HTML table with the results (which is basically what a GridView does).

    I'm guessing however, that you would be better served just using native GridView databinding. You can use a .Net UpdatePanel around the grid if you want to prevent full post backs.

    评论

报告相同问题?

悬赏问题

  • ¥15 安卓adb backup备份应用数据失败
  • ¥15 eclipse运行项目时遇到的问题
  • ¥15 关于#c##的问题:最近需要用CAT工具Trados进行一些开发
  • ¥15 南大pa1 小游戏没有界面,并且报了如下错误,尝试过换显卡驱动,但是好像不行
  • ¥15 没有证书,nginx怎么反向代理到只能接受https的公网网站
  • ¥50 成都蓉城足球俱乐部小程序抢票
  • ¥15 yolov7训练自己的数据集
  • ¥15 esp8266与51单片机连接问题(标签-单片机|关键词-串口)(相关搜索:51单片机|单片机|测试代码)
  • ¥15 电力市场出清matlab yalmip kkt 双层优化问题
  • ¥30 ros小车路径规划实现不了,如何解决?(操作系统-ubuntu)