Add "General handler" under the root directory of the website with the suffix ". ashx"
The Code is as follows:
Code:
- <% @ Webhandler Language = "C #" class = "sample" %>
- Using system;
- Using system. Web;
- Using rsstoolkit;
- Public class sample: genericrsshttphandlerbase {
- Protected override void populatechannel (string channelname, string username)
- {
- // Add a channel
- Channel ["title"] = "sample channel ";
- // If the channel name is not blank
- If (! String. isnullorempty (channelname ))
- {
- // Set the channel name
- Channel ["title"] + = "'" + channelname + "'";;
- }
- // If the access user name is not blank
- If (! String. isnullorempty (username ))
- {
- // Set the user name
- Channel ["title"] + = "(generated for" + username + ")";
- }
- // Set other default channel attributes
- // Here is the RSS of the simple Reader
- Channel ["Link"] = "~ /Default. aspx ";
- Channel ["Description"] = "subscribe to this channel ";
- Channel ["TTL"] = "10 ";
- Channel ["name"] = channelname;
- Channel ["user"] = username;
- // Define items
- Genericrsselement item;
- // Create an item in a channel
- Item = new genericrsselement ();
- // Assign a value to the basic attribute of the item
- Item ["title"] = "complex ";
- Item ["descrption"] = "Full RSS Application complex RSS using rssdatasource ";
- Item ["Link"] = "complexrss. aspx ";
- // Add the item to the Channel
- Channel. Items. Add (item );
- // Create an item in a channel.
- Item = new genericrsselement ();
- Item ["title"] = "";
- Item ["Description"] = "";
- Item ["Link"] = "";
- Channel. Items. Add (item );
- }
- }
Add rsshyperlink to the navigateurl :~ /XX. ashx
OK, browsing Effect