链接到下一篇文章asp.net [英] link to next previous article asp.net

查看:54
本文介绍了链接到下一篇文章asp.net的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好

我有两页:

1- articles.aspx页面显示所有标题文章

2- article详细信息.aspx页面显示完整的سpecific artical(从地址栏获取id)



现在:在articleDetails.aspx页面如何添加下一个和上一个链接以移动到下一个或以前的文章?



注意:文章的ID不是连续的(因为管理员可以删除任何文章)



请帮忙......

我的问候

解决方案





即使您的ID不是顺序的,但您至少可以从数据库中检查下一个文章编号。您可以在数据库上查询,例如,


 选择  top   1  * 来自文章 where  articleid> currentArticleID 订单  articleid 



您还需要最后一篇文章和所有其他可能的场景。



希望这对你有帮助。



祝你好运


Hi all
I''ve tow pages :
1- articles.aspx page that show all headline articles
2- articleDetails.aspx page that show full سpecific artical ( take id from address bar)

now: in articleDetails.aspx page how can i add next and previous links to move to next or previous article?

note: IDs of articles not Sequential ( because admin can delete any article )

please help ...
my regards

解决方案

Hi,

Even your ID is not sequencial but you can at least check the next article number from the database. you can query on the database like,

select top 1 * from articles where articleid > currentArticleID order by articleid 


you also need to cosider last article and all other possible scenarios.

hope this may help you.

best luck.


这篇关于链接到下一篇文章asp.net的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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