ASP.NET pagination - getting it to work properly?

对着背影说爱祢 提交于 2019-12-02 13:41:36

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

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.

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

You do know that you can write ASP.NET code exactly like classic ASP or PHP, right? You don't have to use all those ASP.NET web server controls, you can simply output your own HTML directly, and put the logic in <% ... %> and <%= ... %> tags.

(In fact you can sometimes change a classic ASP page to an ASP.NET one just by adding a couple of header lines and changing the extension to .aspx!)

It's what I prefer to do, since I like to have 100% control over the HTML output, and you don't have that using server controls. Personally, I love coding in ASP.NET but I hate the server controls!

Just write your page the same way you would in PHP (except using C# or whatever .NET language you prefer for the actual code), and it should be easy!

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