链接到下一篇文章asp.net [英] link to next previous article 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屋!