此场景的 Web 表单表格控件 [英] Web Forms Tabular Control for this Scenario

查看:22
本文介绍了此场景的 Web 表单表格控件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在开发一个具有两列布局的 asp.net 网站.在左侧,我们有菜单项.基于单击菜单项,右侧项的内容会发生变化(可见性被切换).右侧的内容是表格数据.表格提供基于所选菜单项的详细信息.

I am developing an asp.net website with two column layout. On the left side we have menu items. Based on the click of the menu item, contents of the right item changes (visibility is toggled). Contents of the right side are tabular data. The tables provide details based on the selected menu item.

环境:Visual Studio 2010、ASP.Net 4.0

Environment: Visual Studio 2010, ASP.Net 4.0

Service:WCF 服务(我们可以控制服务)

Service: WCF service (We have control over the service)

现在,只要性能良好,我就可以完全灵活地决定行为.

Now, I have full flexibility of deciding the behavior so long as the performance is good.

要求

  1. 表格需要分页和排序.这些表应该能够进行服务器端分页(或自定义分页),因为在第一次加载时加载所有数据会影响性能.

  1. The tables require paging and sorting. The tables should be able to do server side paging (or custom paging) as loading all data in the first load will be a performance hit.

右侧内容"的加载应该是部分渲染.我计划根据单击的菜单项控制各种元素的可见性.页面中将有大约 10 个表.因此,应仅按需加载表数据.当页面第一次加载时,它应该只有一个表中的数据.其他表格应该是空白的.

The loading of "right side content" should be partial rendering. I am planning to control the visibility of various elements based on the clicked menu item. There will be around 10 tables in the page. Hence the table data should be loaded on demand only. When the page is loaded for the first time, it should be having data only in one table. Other tables should be blank.

我可以使用经过验证的开源 jQuery 插件

I can use proven open source jQuery plugins

从使用网格视图开始,有很多方法可以实现它.什么是最适合上述表格功能的控件?

There are many ways to achieve it starting with use of Grid View. What is the best suitable control for the above tabular functionality?

阅读

  1. 分页使用动态创建的 html 表

高性能网站 http://video.yahoo.com/watch/1040890/3880720

ASP.NET 性能检查表 http://msdn.microsoft.com/en-us/library/ms998596.aspx

ASP.NET Performance Checklist http://msdn.microsoft.com/en-us/library/ms998596.aspx

高效分页大量数据 (C#) http://www.asp.net/web-forms/tutorials/data-access/paging-and-sorting/efficient-paging-通过大量数据-cs

Efficiently Paging Through Large Amounts of Data (C#) http://www.asp.net/web-forms/tutorials/data-access/paging-and-sorting/efficiently-paging-through-large-amounts-of-data-cs

推荐答案

对我来说听起来像是 MVC3 和 Razor Views 的工作.我已经为我的网格做了类似的部分视图,它反过来呈现排序标题和分页控件的部分视图,所有这些都是(或包含)Ajax.ActionLink 项目,它们通过排序方式、排序方向、每行page 等参数到我的 GoToPage、SortGrid 和 ChangeRowsPerPage 操作.

Sounds like a job for MVC3 and Razor Views to me. I've done something similar with a partial view for my grid which in turn renders partial views for the sort headers and the paging controls, all of which are (or contain) Ajax.ActionLink items which pass sort by, sort direction, rows per page, etc. args to my GoToPage, SortGrid, and ChangeRowsPerPage actions.

我还有一个 PagingModel、一个包含 PagingModel 的 SortHeaderModel 和各个表的模型,其中还包括 PagingModel.将表名作为分页模型中的属性,Ajax.ActionLinks 可以将其传递回它们调用的操作,并且可以使用 switch 块将其他参数传递给适当模型的构造函数,然后该模型将新页面的数据交给网格局部视图.

I also have a PagingModel, a SortHeaderModel which contains a PagingModel, and models for the individual tables, which also include PagingModel. With the table name as a property in the paging model, the Ajax.ActionLinks can pass that back to the actions they call, and a switch block can be used to pass the other parameters to the constructor for the appropriate model, and then that model is handed to the grid partial view with the fresh page of data.

它有效,除了当前可查看的数据页面外,我从不向浏览器传递任何内容.

It works, and I never pass anything but the currently viewable page of data to the browser.

这篇关于此场景的 Web 表单表格控件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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