ASP.NET数据视图 [英] ASP.NET Dataview

查看:94
本文介绍了ASP.NET数据视图的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你好!

我是ASP.NET的初学者.我正在创建一个学生注册页面,其中包含大量信息.之后,将其输入数据库.现在,我想创建一个数据视图,显示所有记录,如每页20条.除此之外,我主要关心的是执行搜索.我希望用户能够使用众多条件来搜索记录.因此,我无法继续为用户希望搜索的所有条件创建下拉框和文本框.

我的问题是:
我知道这是可能的,但我不知道如何,我希望用户单击搜索按钮,整个数据视图将变为空白,只有1行类似于插入行.用户将在他希望的任何字段中输入任何条件.按提交时,应用程序将检查所有条件并返回相应的数据,然后再次填充数据视图.

我认为这是早先用于数据网格的.请协助.这很紧急.

预先感谢.

Hi there!

I am a beginner in ASP.NET. I am creating a student registration page with a ton of information to be added. After, this is entered into the db. Now, i want to create a data view showing all the records like 20 per page. Apart from that, my main concern is implementing the searching. I want the user to be able to search the records using numerous criteria. Therefore, i cannot keep making drop boxes and text boxes for all the criteria the user would wish to search against.

My question is:
I know this is possible but i don''t know how, i want the user to click a search button, where the whole data view will become blank except 1 row which will be like an insert row. The user will enter whatever criteria in whatever fields he wishes. On pressing submit, the application will check all the criteria and return the corresponding data and again fill the data view.

I think this was used earlier with the data grid. Kindly assist. This is very urgent.

Thanks in advance.

推荐答案

1.好的.这对您来说很紧急,但您需要保持耐心才能得到回应.
2.您说您需要搜索功能,但描述了过滤器的需求.您实际上需要什么,正在尝试做什么?有什么问题吗?

搜索:
放置与之相关的控件,然后将其单击按钮.在该事件上,传递控件搜索参数,在查询中使用它并获取数据,将其与网格绑定,然后显示.

对于过滤器:
您可以使用相同的数据集,只需使用DataView对其进行过滤并将其显示在网格中即可.

立即尝试!
1. Ok. It''s urgent to you, but you need to keep patience to get response.
2. You say you need a Search functionality but describe a filter need. What actually you need and what are trying to do? What is the issue?

For search:
Place the controls related to it and then on a button click event. On that event, pass on the control search parameters, use it in query and fetch data, bind it with grid, show it.

For Filter:
You can use the same dataset, just use DataView to filter it and show it in the grid.

Try now!


感谢您的回复.

据我所记得;这样做的方式是:

他们有一个带有数据网格的datagrid,例如:

年龄性别DOB

1.加载页面后,数据网格将从数据库中获取所有信息并显示它.

2.数据网格中有一个插入选项,用于添加新的信息行,该信息以后将存储在db

3.与插入类似,我想要一个搜索选项,当用户单击搜索时,datagrid不会显示任何数据库信息,而只会显示一个表格,上面的列和1行用于输入数据.

4.例如:

年龄性别DOB
5

当用户写下以上内容并按确定"按钮时,所有年龄在5岁以下的人都将再次填充数据网格.

我想要网格中的搜索功能,因为我的表中的列太多了.我不想创建单独的网格外搜索.

希望你能理解我的意思

Thnx
Thank you for you response.

Well as far as i remember; the way some did it was:

they had a datagrid with a the data columns lets say for eg:

Age Gender DOB

1. Upon loading the page, the data grid would get all the informationf rom the db and display it.

2. There was an insert option in the data grid to add a new row of information, which would later be stored in the db

3. similar to the insert, i want a search option, when the user clicks search,the datagrid shows no db information, rather than just a table with the columns above and 1 row to enter data.

4. For example:

Age Gender DOB
5

when the user writes the above and presses the ok button, the data grid is again populated with all those with age 5

i want the search functionality in the grid, as i have a table with way too many columns. I do not want to create a seperate out of the grid search.

I hope you get my point

Thnx


这篇关于ASP.NET数据视图的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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