[My Blog] | [Code Projects Home] | [skmMenu] | [RssFeed]

Expandable Descriptions - Client-Side

This demo illustrates how to use templates and a bit of client-side DHTML to provide expandable descriptions. Click on the title of a blog entry to view the description... (Complete source code available at the bottom...)

 

Scott on Writing

Determining Whether a String Is Contained Within a String Array (Case Insensitive)


3/9/2010

FIX: It is an error to use a section registered as allowDefinition='MachineToApplication' beyond application level. This error can be caused by a virtual directory not being configured as an application in IIS


2/17/2010

January's Toolbox Column Now Online


1/8/2010

SOLUTION: Outlook Is Stripping Line Breaks From Plain-Text Emails Auto-Generated From My ASP.NET Application!


12/8/2009

December's Toolbox Column Now Online


12/1/2009

Configuring the PasswordRecovery To Send Email to an SSL-Enabled SMTP Client


11/10/2009

November's Toolbox Column Now Online


11/5/2009

TIP: How To Generate a Fully Qualified URL in ASP.NET (E.g., http://www.yourserver.com/folder/file.aspx)


10/26/2009

Rich Tooltips With jQuery


10/23/2009

SOLUTION: JSLint.VS Add-In Always Reports "No Errors" Even For Invalid JavaScript Files


10/15/2009

October's Toolbox Column Now Online


10/2/2009

Deleting All Records In a Table EXCEPT For the N Most Recently Added Records


10/1/2009

PROBLEM: CSS Styles No Longer Apply For Anonymous Users


9/28/2009

September's Toolbox Column Now Online


9/10/2009

A Tool For Querying Multiple Databases


9/8/2009

[View Other RssFeed Demos] | [Return to the RssFeed Homepage]


HTML Portion
<script language="javascript">
<!--
   function showHide(panelID)
   {
      var panel = document.getElementById(panelID);
      if (panel != null)
      {
         if (panel.style.visibility == "hidden")
         {
            panel.style.display = "block";
            panel.style.visibility = "visible";
         } else {
            panel.style.display = "none";
            panel.style.visibility = "hidden";               
         }
      }
   }
// -->
</script>

<skm:RssFeed Width="67%" HorizontalAlign="Center" id="RssFeed1" runat="server" Font-Name="Arial">
   <HeaderStyle Font-Size="X-Large" ForeColor="White" BackColor="#400040" HorizontalAlign="Right"></HeaderStyle>
   <ItemTemplate>
      <h2 onclick="javascript:showHide('panel<%# Container.ItemIndex %>');"><%# Container.DataItem.Title %></h2>
      <br />
      <div id="panel<%# Container.ItemIndex %>" style="visibility: hidden; display: none;">
         <%# Container.DataItem.Description %>
      </div>
      <span style="font-size:small;font-style:italic;">
         <%# Container.DataItem.PubDate.ToShortDateString() %>
      </span>
   </ItemTemplate>
</skm:RssFeed>
Code-Behind Portion
private void Page_Load(object sender, EventArgs e)
{
	RssFeed1.DataSource = "http://scottonwriting.net/sowblog/Rss.aspx";
	RssFeed1.DataBind();
}