Register
|
Articles
|
Questions
|
Projects
|
Asp.Net Tips
|
Free Magazines
|
Tutorials
|
Search
|
Write to us
|
Login
Search
Articles
Asp.Net 2.0
AJAX
ADO.Net
C#
Javascript
Books
Asp.Net 2.0
AJAX
ADO.NET
C#
JavaScript
MS SQL Server
VB.NET
XML
Web Service
Resources
Asp.Net News
Downloads
Free Tech Magazines
Asp.Net Web Hosting
Archives
Softwares
Newsletter
Suggest Us
Link to Us
Feeds Subscription
Articles
Questions & Answers
Tips & Tricks
How to Dynamically Enable/Highlight RSS Button in IE or FireFox From Asp.Net?
Posted by
Moderator1
on
9/24/2009 10:18:02 AM
521
Views
Now days, every web browser has the capability of identify the existence of RSS feeds in the web page. Most of the developer/programmer think it as a built-in function of the browser. But it is NOT.
We have to include script in the html between the <head></head> tags, then only the web browser either IE or FireFox, will identity the RSS feeds in the page and enable the RSS button in it. The link to be added between the <head></head> tags are below
<link rel="alternate" type="application/rss+xml" title="AspdotnetCodes.com - Latest Articles" href="http://www.aspdotnetcodes.com/rss.aspx" />
After you add the above <link /> script, browse your page, you can see the RSS button is enabled.
Now, to add the above link script dynamically from the code-behind, add the below code in your page event.
HtmlLink link = new HtmlLink();
link.Attributes.Add("rel", "alternate");
link.Attributes.Add("type", "application/rss+xml");
link.Attributes.Add("title", "AspdotnetCodes.com - Latest Articles");
link.Attributes.Add("href", "http://www.aspdotnetcodes.com/rss.aspx");
Page.Header.Controls.Add(link);
Post New Tips/Tricks
View all Tips/Tricks
Featured Resources:
Simply SQL - Free 111 Page Preview!
Simply SQL is a practical step-by-step guide to writing SQL.
Everything You Know About CSS Is Wrong! - Free 37 Page Preview!
For web designers and developers who want to ensure they're using the very latest, best-practice CSS techniques.
100% Free Subscription until Stock lost.
View complete list.
Sponsored by
Home
About us
Contact Us
Links
Advertise
Privacy Policy
Copyright ©
2010
. www.AspdotnetCodes.com. All rights reserved.