Using jqGrid in ASP.NET WebForms

拟墨画扇 提交于 2020-01-05 03:24:08

问题


I've implemented and used a pretty functional grid through this tutorial for MVC:

http://www.codeproject.com/KB/aspnet/AspNetMVCandJqGrid.aspx

I was wondering how to migrate this to ASP.NET WebForms, for another project I want to use jqGrid on, but is written in WebForms instead of MVC.

I've found some examples but they're rather incomplete (require me to declare the columns in both js and codebehind, don't feature paging, no multi-filtering, etc)


回答1:


Jquery and page methods in WebForms application are working well together. ( http://www.junasoftware.com/blog/using-jquery-ajax-and-page-methods-with-a-asp.net-webservice.aspx ) After glance on the article you pointed to, I think they will work too. Here are what I think you should do.

  1. Including the article above I mentioned, read more on using jquery with page method.
  2. you will be able to reuse most of html and javascripts and c# data structures for communicating with jquery from the article (of codeproject).
  3. What you need to do is that basically, you have to make your page method act as a controller while aspx as views. And adjust other elements accordingly. One thing you have to remember is that page method should be static.


来源:https://stackoverflow.com/questions/7034713/using-jqgrid-in-asp-net-webforms

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!