Cursul oficial BNR
It is very nice and user-friendly to have Webslices on your website. It improves the user experience by allowing visitors to be up to date with the latest content that you provide, assuming that it is fitted to this presentation style. Since my BNR exchange rates page was this kind, I pursued in adding a Webslice especially for it.
Adding a webslice to your website is simple. After you read the main specifications or my previous article, you’ll understand the concept behind: first you signal to the browser that you have a special part of your website by setting to a container element the class “hslice”:
<div id="BNRExchange" class="hslice"> <div style="display: none" class="entry-title"> <img id="image" alt="Radu Poenaru's weblog gives you BNR Exchange rates" src="http://www.radupoenaru.com/bnr/images/radupoenaru.jpg" width="128" height="128" /> <p> Cursul oficial BNR </p> </div> <p> <a style="display: none" href="http://www.radupoenaru.com/bnr/bnr.php" rel="entry-content"> <a style="display: none" href="http://www.radupoenaru.com/bnr/bnr.php" rel="Bookmark" target="_blank"> <span style="display: none" class="ttl">5</span> </p> <div id="updateTrigger" class="entry-content" runat="server" /> ........ your content that you want surrounded by the green webslice part .............. </div>
The id of the container must be the same for all the container who contain the same information – as in my case, the graph of the exchange rates must have the same Id on every page.
Then you have to specific the refresh period of the page by using the ttl class, set at 5 minutes intervals in my case.
Another very interesting thing on this technology is that you can surround content with it, making clear to the user what he will use if he wants that Webslice’s content.