使用的jqGrid与Asp.Net Web窗体 [英] Using jqGrid with Asp.Net Web Forms

查看:312
本文介绍了使用的jqGrid与Asp.Net Web窗体的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我使用 Asp.Net/C#在我的申请,我有我需要显示在的jqGrid .The数据应该来自用户 table.This是我第一次与的jqGrid ,任何人都可以帮助我开始与的jqGrid Web窗体。任何实例或链接会大大AP preciated。
谢谢你。

I am using Asp.Net/C# in my application ,I have a requirement where I need to show data in a jqGrid.The data should come from a Users table.This is my first time with jqGrid, can anybody help me out to start with jqGrid with Web Forms.Any examples or links would be much appreciated . Thanks.

推荐答案

您可以包括在任何应用程序只是为了在网格底部

You can include in any application just an empty table element and empty div for the pager at the bottom of the grid

<table id="grid" ></table>
<div id="pager"></div>

然后包括

<script type="text/javascript">
$(function () {
    $("#grid").jqGrid({
        url: 'someURLfromYourProject', // 'xxx.svc', 'xxx.asmx', 'xxx.ashx' ...
        datatype: 'json',
        pager: '#pager',
        gridview: true,
        height: 'auto',
        //... other parameters
    });
});
</script>

这将在运行时的空表和DIV在网格中修改。杉木网格中的数据将是由网​​址选项。

要明白,你可以很容易的集成WFC,ASMX Web服务或在任何您现有的应用程序ASHX处理程序是很重要的。你只需要添加新的页面(选择在ASP.NET项目的解决方案资源管理器添加新项上下文菜单)添加到您现有的项目。在路上,你将创建code这是从主要用在ASP.NET应用程序的技术更加独立。如果以后决定迁移到ASP.NET MVC,你甚至不能改变WFC ASMX Web服务或应用程序的ASHX处理部分的适用范围。

It's important to understand that you can very easy integrate WFC, ASMX web service or ASHX handler in any your existing application. You need just add new page (choose "Add new Item" context menu in the Solution Explorer of your ASP.NET project) to your existing project. In the way you will create the code which are more independent from the technology used mainly in your ASP.NET application. If you decide later to migrate the application to ASP.NET MVC you can even not change the WFC ASMX web service or ASHX handler part of the application.

答案你会发现一些网址演示项目,你可以下载并播放了一点。您可以移动从ASP.NET MVC的例子最code(请参阅 href=\"http://stackoverflow.com/a/9349688/315935\">和的这里)到你的WCF / ASMX / ASHX code

In the answer you will find some URLs with demo projects which you can download and play a little. You can move the most code from the ASP.NET MVC example (see here and here) to your WCF/ASMX/ASHX code.

这篇关于使用的jqGrid与Asp.Net Web窗体的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆