ASP.NET分页 - 得到它才能正常工作? [英] ASP.NET pagination - getting it to work properly?

查看:177
本文介绍了ASP.NET分页 - 得到它才能正常工作?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我现在有一个电视指南,正确地显示在TABL从数据库中数据的ASP.NET脚本,截至提到
http://www.15seconds.com/issue/050407.htm 和它运作良好

I currently have an ASP.NET script for a TV guide which displays the data from the database properly in a tabl, as mentioned at http://www.15seconds.com/issue/050407.htm and it works well.

的code表示得到MySQL是同前述的链路,除了用户名和MySQL的密码,和数据库,以及

The code for getting the MySQL is the same as that of the link above, except for username and password of MySQL, and the database as well.

数据示例:

06:00 Breakfast News
06:45 The Force
07:45 House M.D.
08:15 Police Stop!
09:15 Showbiz Gossip
09:45 Quantum Leap
10:45 Harry Hill's TV Burp

不过,数据显示以表格的形式,与边框,与时代应显示为:

However, data displays in a tabular format, with borders, and the times should display as:

上午6:00
上午6:45

6:00am 6:45am

等。

但我目前正在创建一个ASP.NET分页像这样的节目/节目指南和广播时间:

but I'm currently trying to create an ASP.NET pagination like this for programme/episode guide and air times:

http://library.digiguide.tv/lib/programmenextshowing/21260

虽然,在示例站点的经典ASP,我的是ASP.NET。

Although that's classic ASP in the example site, mine is ASP.NET.

我想效仿他们的分页的风格,与MySQL,但似乎无法得到它的工作 - PHP是没有问题的,但是,对于这个电视台网站实际的虚拟主机不支持PHP,<强>仅 ASP.NET。我通常使用aspdotnet与Apache的modaspdotnet,但我将使用它仅支持ASP.NET [但包括MySQL的以及]

I'm trying to emulate their style of pagination, with MySQL, but can't seem to get it to work - PHP is no problem, however, the actual webhost for this TV website doesn't support PHP, only ASP.NET. I normally use aspdotnet with modaspdotnet on Apache, but am going to be using it on a webhost that supports ASP.NET only [but includes MySQL as well].

这是从我的数据库之一我的数据库字段, quantumleapguide

These are my database fields from one of my databases, quantumleapguide

程序
渠道
插曲(应该是空白的,如果没有情节,在引号有一集的名字,如果插曲)
seriesno
episodeno

programme channel episode (should be blank if no episode, have episode name "in quote marks" if episode) seriesno episodeno

和应显示为:

    Quantum Leap    showing on TV Channel 1 23rd June - 6:25pm  "Test Episode"
Series 1, episode 4.    Set Reminder
    Quantum Leap    showing on TV Channel 1 24th June - 1:25am  
Set Reminder

我将如何得到这个作为一个ASP.NET脚本的工作 - 我曾尝试一些人关谷歌,而且他们没有完全成功,显示的数据是与边框的表格

How would I get this to work as an ASP.NET script - I did try some of them off Google, and they were not entirely successful, the data displayed was as a table with borders.

这是code我希望它在浏览器中渲染(道歉,将不得不滚动看到它如何工作):

This is the code I expect it to render in the browser (apologies, will have to scroll to see how it should work):

<tr><td><b><a href="quantumleap.aspx">Quantum Leap</a></b></td><td>showing on <a href="channel/1.aspx><i>Channel 1</i></a></td><td>23rd June - 6:25pm</td><td><b>"<a href="/library/episode/1.aspx">Test</a>"</b><br>Series 1, episode 4.</td></tr>
<tr><td><b><a href="quantumleap.aspx">Quantum Leap</a></b></td><td>showing on <a href="channel/1.aspx><i>Channel 1</i></a></td><td>24th June - 1:25am</td><td><b>"<a href="/library/episodes/1.aspx">Test</a>"</b></td></tr>
<tr><td><b><a href="quantumleap.aspx">Quantum Leap</a></b></td><td>showing on <a href="channel/1.aspx><i>Channel 1</i></a></td><td>24th June - 11:50am</td><td>&nbsp;</td></tr>

您有什么建议的方式来解决这个问题,并把它运作良好,因为在ASP.NET分页previous努力都没有奏效?

What would you suggest as a way to fix this and have it working well, since previous attempts at ASP.NET pagination haven't worked?

任何及所有帮助AP preciated。

Any and all help appreciated.

推荐答案

我想你问的是如何处理创造一个ASP.NET编程指南。

I think what you're asking is how to approach creating a programming guide in ASP.NET.

要完成他们在使用ASP.NET的digiguide.tv链路上的东西,我会与MySQL检索数据,把它放在一个有效的数据源,而数据源绑定到ListView或类似的控制。 <一href=\"http://weblogs.asp.net/scottgu/archive/2007/08/10/the-asp-listview-control-part-1-building-a-product-listing-page-with-clean-css-ui.aspx\"相对=nofollow>这是一个很好的教程。您的内部为ListView,你可以创建你共享code该表。

To accomplish what they have on the digiguide.tv link using ASP.NET, I would retrieve your data with MySQL, put it in a valid datasource, and bind that datasource to a ListView or similar control. This is a good tutorial. Inside your for the ListView, you would create that table that you shared the code for.

那么对于寻呼,ASP.NET有一个名为DataPager控件,它可以让您轻松完成服务器端分页进行有针对性的列表视图。

Then for the paging, ASP.NET has a control called DataPager, which allows you to easily accomplish server side paging for a targeted listview.

这篇关于ASP.NET分页 - 得到它才能正常工作?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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