如何使用 ASP.Net 2.0(C#) 创建 SEO 友好的分页(Digg.com 风格)?
我使用本文为 ASP.Net 2.0(使用 C#)网站的 gridview 控件创建了 digg.com 样式的分页: http://kpumuk.info/asp-net/gridview-with-custom-digg-like-pager/
为了实现digg.com风格,上述文章的作者定制了gridview控件,并使用两个派生控件(gridview和链接按钮控件)创建了一个名为GridviewWithPager的C#控件,该控件允许向应用程序添加Digg样式的分页。
但这种分页不利于 SEO,因为它使用链接按钮控件和 javascript。 我在某处读到,对于 SEO 分页,应使用超链接而不是链接按钮控件。 而对于大家都知道的javascript,它会使页面无法被搜索引擎访问。
现在我想让这个 digg.com 风格的分页 SEO 友好。
我想问的问题是:
- 我是否应该删除链接按钮控件并使用超链接控件来链接SEO分页中的页面?
- 我可以通过一些修改和添加来使这个 digg.com 风格的分页 SEO 友好吗?
- 如果是这样,那么我需要进行哪些修改和添加?
- 我是否必须从我的网站中删除此 GridviewWithPager 控件并使用默认的 gridview 和一些自定义的 SEO 友好分页?
请随时提供有关 SEO 分页的任何其他附加信息或建议。
任何帮助将不胜感激。 提前致谢。
恩扎赫拉。
I have created a digg.com style pagination for my ASP.Net 2.0 (with C#) website's gridview control using this article: http://kpumuk.info/asp-net/gridview-with-custom-digg-like-pager/
In order to achieve digg.com style, the author of the above mentioned article has customized gridview control and created a C# control named as GridviewWithPager using two derived controls (gridview and link button control), which allowed to add Digg-style pagination to an application.
But this pagination is not SEO friendly as it uses link button control and javascript.
I have read somewhere that for SEO pagination hyperlink should be used instead of link button control.
While for javascript everyone knows, it makes the pages inaccessible to search engine.
Now I want to make this digg.com style pagination SEO friendly.
The questions I want to ask are:
- Is this true that I should remove the link button control and use hyperlink control for linking the pages in SEO pagination?
- Can I make this digg.com style pagination SEO friendly with some modification and addition?
- If so, then what modifications and additions I will be required?
- Do I have to remove this GridviewWithPager Control from my website and use the default gridview with some customized SEO friendly pagination?
Please feel free to give any other additional information or suggestion on SEO pagination.
Any help will be really appreciated.
Thanks in advance.
nzahra.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
是的。 搜索引擎需要切换到常规超链接才能跟踪链接。 另外,您还将获得较小视图状态的额外好处,这也有助于搜索引擎优化。 根据经验,文本与 html 的比率越高越好。 因此,如果您希望视图状态在搜索引擎中表现良好,那么减小视图状态的大小应该是优先考虑的事情。
是的,尽管你最好完全从其他事情开始。 尽管 GridView 可以轻松地使用所有内置功能,但它们也存在一些问题,有时会导致效率低下。
事实上,对于一个面向公众的网站,我会完全放弃 GridViews 并采用老式方法。 我会使用最简单的数据控制——中继器。 您也许可以在其他地方找到功能更丰富的示例,但这里有一篇文章描述了如何将简单的分页应用于转发器控件:
http://www.vbasic.net/detail.aspx?tid=106
就像在这个例子中一样,我将使用查询字符串创建分页。 这样,您将获得 SEO 的好处,并在用户点击返回时获得更好的用户体验。 浏览器中的前进按钮。 不要离题太远,但我讨厌的一件事是“确认表单重新提交”对话框,尤其是在执行诸如逐步浏览结果页面之类的简单操作时。 使用查询字符串而不是表单帖子是消除这种情况的一种方法。
这是您可能想要遵循的另一个示例,尽管使用的是不同的语言:
http://www.seoegghead.com/ blog/seo/stop-seo-death-by-pagination-p118.html
他有充分的理由这样做。 您可能还注意到他使用 URL 重写而不是查询字符串,这需要更多的工作。 但如果您愿意付出努力,URL 重写的结构化性质可以使其成为 SEO 的终极选择。
Yes. Switching to regular hyperlinks will be necessary for search engines to follow the links. Plus you'll get the added benefit of a smaller viewstate, which can help SEO as well. As a rule of thumb, the higher the textual content-to-html ratio, the better. So reducing the size of the viewstate should be a priority if you want it to do well in the search engines.
Yes, although you may be better off starting from something else entirely. As easy as GridViews can be to use with all of the built-in functionality, there are some problems with them which makes them inefficient at times.
In actuality, for a public facing site I'd scrap GridViews entirely and go old-school. I'd use the simplest data control -- the repeater. You may be able to find a more feature-rich example somewhere else, but here's an article describing how to apply simple pagination to the repeater control:
http://www.vbasic.net/detail.aspx?tid=106
Just like in this example, I'd create pagination with querystrings. That way you'll get the benefit of SEO, as well as an improved user experience when the user hits the back & forward buttons in their browser. Not to go too far off on a tangent, but one thing I hate is the "Confirm form resubmission" dialog box, especially when doing something as simple as stepping through pages of results. Using querystrings instead of form posts is one way to eliminate that.
Here's another example you might want to follow, albeit in a different language:
http://www.seoegghead.com/blog/seo/stop-seo-death-by-pagination-p118.html
He has good reasons to do it the way he did. You may also notice he uses URL rewriting instead of querystrings which requires a little more work. But if you're willing to put in the effort, the structured nature of URL rewriting can make it the ultimate for SEO.
这是一个您可以使用的类:
http://davidpirek.com/blog.aspx? n=asp.net-mvc-paging-using-dataset
here is a class that you can use:
http://davidpirek.com/blog.aspx?n=asp.net-mvc-paging-using-dataset