<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/rss2full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.feedburner.com/~d/styles/itemcontent.css"?><rss xmlns:blogChannel="http://backend.userland.com/blogChannelModule" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:pingback="http://madskills.com/public/xml/rss/module/pingback/" xmlns:trackback="http://madskills.com/public/xml/rss/module/trackback/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" version="2.0">
  <channel>
    <title>the WebNeck</title>
    <description>Dot Net, C#, CSS, AJAX</description>
    <link>http://www.thewebpepper.net/</link>
    <docs>http://www.rssboard.org/rss-specification</docs>
    <generator>BlogEngine.NET 1.6.0.0</generator>
    <language>en-US</language>
    <blogChannel:blogRoll>http://www.thewebpepper.net/opml.axd</blogChannel:blogRoll>
    <blogChannel:blink>http://www.dotnetblogengine.net/syndication.axd</blogChannel:blink>
    <dc:creator>the WebNeck</dc:creator>
    <dc:title>the WebNeck</dc:title>
    <geo:lat>412,392.000000</geo:lat>
    <geo:long>-813,459.000000</geo:long>
    <atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/rss+xml" href="http://feeds.feedburner.com/theWebNeck" /><feedburner:info uri="thewebneck" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><item>
      <title>Handling ASP.Net Session Variables</title>
      <description>&lt;p&gt;There are a multitude of ways to implement Session Variables but developers need know when to use them, a full-proof way on how to minimize errors, and then a good way to implement them which minimizes code written. This article is meant to address these issues.&lt;/p&gt;
&lt;h2&gt;Some say: Cookies "&lt;span style="text-decoration: underline;"&gt;Good&lt;/span&gt;", Session Variables "&lt;span style="text-decoration: underline;"&gt;Bad&lt;/span&gt;"&lt;/h2&gt;
&lt;p&gt;This is only true in some scenarios, when there is a need to have variables which are global in scope for a user's session which &lt;span style="text-decoration: underline;"&gt;do not&lt;/span&gt; hold sensitive information. Sensitive information would be something like user logins and passwords, and any information that maybe part of a secure site (https). Also, if your site is using a database all these variables should be kept there, there are ways on the db side which can be implemented to secure this sensitive information even further. In addition, the use of session variables increases the overhead on the server and cookies reduce this overhead, especially on large sites with a multitude of users.&lt;/p&gt;
&lt;p&gt;So when should session variables be used? Well, when a database is unavailable, when there is a need to keep private information private and to be able use this information globally throughout the site for the user's session.&lt;/p&gt;
&lt;h2&gt;How Not To Implement Session Variables&lt;/h2&gt;
&lt;p&gt;Many sites have implemented a poor method of using session variables mainly, because it was easy and not much thought given to the impact of this implementation down the road. Here is a common way, but a &lt;strong&gt;poor&lt;/strong&gt; way of implementing the use Session Variables:&lt;/p&gt;
&lt;!-- code formatted by http://manoli.net/csharpformat/ --&gt;
&lt;pre class="csharpcode"&gt;&lt;span class="rem"&gt;// Poor Implementation: Writing to a session variable&lt;/span&gt;
Session[&lt;span class="str"&gt;"Password"&lt;/span&gt;] = strSomeTextBox.Text;
        
&lt;span class="rem"&gt;// Poor Implementation:  Reading from a session variable&lt;/span&gt;
&lt;span class="kwrd"&gt;string&lt;/span&gt; strPassword = Session[&lt;span class="str"&gt;"Password"&lt;/span&gt;].ToString();
&lt;/pre&gt;
&lt;p&gt;Although, the syntax is correct, this implementation is just asking for trouble. Ok, now the site has grown to ~100 pages, ask the questions:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;How many session variables are in use?&lt;/li&gt;
&lt;li&gt;What are they?&lt;/li&gt;
&lt;li&gt;and... How many times have you seen the 'NullReferenceException' error when debugging?&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;This drives a point home, huh...&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;h2&gt;Implementing Session Variables with Class&lt;/h2&gt;
&lt;p&gt;This method will implement 2 new classes. The first one will be a simple, static, shared class which will keep track of all the session variables used and avoids the 'NullReferenceException' errors. The second class is one that will override the default Page class, it will test the condition if the session is still valid, and if not, provide an elegant way to inform the user the session has expired (because in IIS, the session expires after 20 minutes as a default, so there is a need to trap and handle this condition).&lt;/p&gt;
&lt;p&gt;Below is our static, shared class, named &lt;strong&gt;mySessionVar&lt;/strong&gt;, which we will save as &lt;strong&gt;mySessionVaribles.cs&lt;/strong&gt; in the [App_Code] folder, off the root folder. By reviewing the code, you can now see how many session variables are in use, and a full proof way to avoid the dreaded 'NullReferenceException' errors.&lt;/p&gt;
&lt;!-- code formatted by http://manoli.net/csharpformat/ --&gt;
&lt;pre class="csharpcode"&gt;&lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;static&lt;/span&gt; &lt;span class="kwrd"&gt;class&lt;/span&gt; mySessionVar
{ &lt;span class="rem"&gt;// Declare the session state variable: to determine if the session is still valid&lt;/span&gt;
  &lt;span class="kwrd"&gt;private&lt;/span&gt; &lt;span class="kwrd"&gt;static&lt;/span&gt; &lt;span class="kwrd"&gt;string&lt;/span&gt; _strValidSession = &lt;span class="str"&gt;"strValidSession"&lt;/span&gt;;

  &lt;span class="rem"&gt;// Start the list of all the site's Session Variables.............&lt;/span&gt;
  &lt;span class="kwrd"&gt;private&lt;/span&gt; &lt;span class="kwrd"&gt;static&lt;/span&gt; &lt;span class="kwrd"&gt;string&lt;/span&gt; _strPassword = &lt;span class="str"&gt;"strPassword"&lt;/span&gt;;
        
  &lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;static&lt;/span&gt; &lt;span class="kwrd"&gt;string&lt;/span&gt; strValidSession
  {
    get
    { &lt;span class="rem"&gt;// Test for null&lt;/span&gt;
      &lt;span class="kwrd"&gt;if&lt;/span&gt; (HttpContext.Current.Session[mySessionVar._strValidSession] == &lt;span class="kwrd"&gt;null&lt;/span&gt;)
      { &lt;span class="rem"&gt;// If so, return an empty string&lt;/span&gt;
        &lt;span class="kwrd"&gt;return&lt;/span&gt; &lt;span class="kwrd"&gt;string&lt;/span&gt;.Empty;
      }
      &lt;span class="kwrd"&gt;else&lt;/span&gt;
      { &lt;span class="rem"&gt;// not null, return the value&lt;/span&gt;
        &lt;span class="kwrd"&gt;return&lt;/span&gt; HttpContext.Current.Session[mySessionVar._strValidSession].ToString();
      }
    }
    set
    { &lt;span class="rem"&gt;// assign the session variable with the value&lt;/span&gt;
      HttpContext.Current.Session[mySessionVar._strValidSession] = &lt;span class="kwrd"&gt;value&lt;/span&gt;;
    }
  }

&lt;span class="rem"&gt;// NOW: Start defining all the site's Session Variables.............&lt;/span&gt;
  &lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;static&lt;/span&gt; &lt;span class="kwrd"&gt;string&lt;/span&gt; strPassword 
  {
    get
    { &lt;span class="rem"&gt;// Test for null&lt;/span&gt;
      &lt;span class="kwrd"&gt;if&lt;/span&gt; (HttpContext.Current.Session[mySessionVar._strPassword] == &lt;span class="kwrd"&gt;null&lt;/span&gt;)
      { &lt;span class="rem"&gt;// If so, return an empty string&lt;/span&gt;
        &lt;span class="kwrd"&gt;return&lt;/span&gt; &lt;span class="kwrd"&gt;string&lt;/span&gt;.Empty;
      }
      &lt;span class="kwrd"&gt;else&lt;/span&gt;
      { &lt;span class="rem"&gt;// not null, return the value&lt;/span&gt;
        &lt;span class="kwrd"&gt;return&lt;/span&gt; HttpContext.Current.Session[mySessionVar._strPassword].ToString();
      }
    }
    set
    { &lt;span class="rem"&gt;// assign the session variable with the value&lt;/span&gt;
      HttpContext.Current.Session[mySessionVar._strPassword] = &lt;span class="kwrd"&gt;value&lt;/span&gt;;
    }
  }

}&lt;/pre&gt;
&lt;p&gt;Now, the syntax to read and write a session variable defined in the class shown above is:&lt;/p&gt;
&lt;!-- code formatted by http://manoli.net/csharpformat/ --&gt;
&lt;pre class="csharpcode"&gt;&lt;span class="rem"&gt;// The better method: Writing to a session variable&lt;/span&gt;
mySessionVar.strPassword = strSomeTextBox.Text;
        
&lt;span class="rem"&gt;// The better method: Reading from a session variable&lt;/span&gt;
&lt;span class="kwrd"&gt;string&lt;/span&gt; strPassword = mySessionVar.strPassword;&lt;/pre&gt;
&lt;p&gt;Below is our second class which we will use to override the default Page class (System.Web.UI.Page), named &lt;strong&gt;myBasePage&lt;/strong&gt; and we will save it as &lt;strong&gt;myBasePage.cs&lt;/strong&gt; in the [App_Code] folder, off the root folder. This is to handle the condition when the session expires.&lt;/p&gt;
&lt;!-- code formatted by http://manoli.net/csharpformat/ --&gt;
&lt;pre class="csharpcode"&gt;&lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;class&lt;/span&gt; myBasePage : System.Web.UI.Page
{
  &lt;span class="kwrd"&gt;override&lt;/span&gt; &lt;span class="kwrd"&gt;protected&lt;/span&gt; &lt;span class="kwrd"&gt;void&lt;/span&gt; OnInit(EventArgs e)
  {
    &lt;span class="kwrd"&gt;base&lt;/span&gt;.OnInit(e);

    &lt;span class="kwrd"&gt;if&lt;/span&gt; (mySessionVar.strValidSession.Length == 0)
    {
      Response.Redirect(&lt;span class="str"&gt;"../SessionExpired.htm"&lt;/span&gt;);
    }
  }
}&lt;/pre&gt;
&lt;p&gt;Now we'll implement this by using the following on all our .Net Pages, now, if the session times out the user will be redirected (without error) to the SessionExpired.htm page:&lt;/p&gt;
&lt;!-- code formatted by http://manoli.net/csharpformat/ --&gt;
&lt;pre class="csharpcode"&gt;&lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;partial&lt;/span&gt; &lt;span class="kwrd"&gt;class&lt;/span&gt; pgSomePage : myBasePage
{
  &lt;span class="rem"&gt;// your code...&lt;/span&gt;
}&lt;/pre&gt;
&lt;p&gt;instead of this, the Page default&lt;/p&gt;
&lt;p&gt;&lt;!-- code formatted by http://manoli.net/csharpformat/ --&gt;&lt;/p&gt;
&lt;pre class="csharpcode"&gt;&lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;partial&lt;/span&gt; &lt;span class="kwrd"&gt;class&lt;/span&gt; pgSomePage : System.Web.UI.Page
{
  &lt;span class="rem"&gt;// your code...&lt;/span&gt;
}&lt;/pre&gt;
&lt;p&gt;Now, you are all done... !&lt;/p&gt;
&lt;h2&gt;Oh, Your Site is &lt;span style="text-decoration: underline;"&gt;still&lt;/span&gt; using Frames, Response.Redirect() isn't Working Correctly?&lt;/h2&gt;
&lt;p&gt;You need to clear the screen and bust out of the frames, well, switch over to MasterPages... No, just kidding!&lt;/p&gt;
&lt;p&gt;We'll just add another step to the redirection. First, we'll hide this page (SessionExpired.htm) by not displaying any content but use this page to break-out of the FrameSet and use javascript's function: window.open('../FramesExpired.htm', '_top') which redirects to the page FramesExpired.htm, and use this page to denote that the Session expired. Here is the code for SessionExpired.htm within the Frameset environment:&lt;/p&gt;
&lt;!-- code formatted by http://manoli.net/csharpformat/ --&gt;
&lt;pre class="csharpcode"&gt;&lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;HTML&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;
&lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;HEAD&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;
&lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;script&lt;/span&gt; &lt;span class="attr"&gt;LANGUAGE&lt;/span&gt;&lt;span class="kwrd"&gt;='JavaScript'&lt;/span&gt; &lt;span class="attr"&gt;TYPE&lt;/span&gt;&lt;span class="kwrd"&gt;='text/javascript'&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt; 
{
  window.open(&lt;span class="str"&gt;'../FramesExpired.htm'&lt;/span&gt;, &lt;span class="str"&gt;'_top'&lt;/span&gt;) 
}  
&lt;span class="kwrd"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;script&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;
&lt;span class="kwrd"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;HEAD&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;
&lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;BODY&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;BODY&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;
&lt;span class="kwrd"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;HTML&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;
&lt;div class="tip"&gt;&lt;strong&gt;Important Note:&lt;/strong&gt;&amp;nbsp;&amp;nbsp;If your site is using frames you still need to use the Response.Redirect() even though it does not have any other parameters which would bust out of the frameset. Each frame is similar to another browser session, the server does not know about the other frames, but on the client side that a different story and that is where client-side script comes into play.&lt;br /&gt;&lt;br /&gt; Well, if you did use Response.Write() to send that javascript code to the client to redirect and bust out of the frames, that code will not fire first. The Page_Load() will fire after OnInit(), and you will probably be using some session variables in Page_Load(), thus causing errors because they expired. The use of Response.Redirect() will halt further processing (preventing Page_Load() from firing) and only redirect to the chosen page.&lt;/div&gt;
&lt;p&gt;Hope this helps!&lt;/p&gt;
&lt;p&gt;&lt;!-- And... comments are always welcome, the good and the bad. --&gt;&lt;strong&gt;&lt;em&gt;the WebPepper team&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/theWebNeck/~4/qCIT_3tXSjE" height="1" width="1"/&gt;</description>
      <link>http://feedproxy.google.com/~r/theWebNeck/~3/qCIT_3tXSjE/post.aspx</link>
      <author>the WebNeck</author>
      <comments>http://www.thewebpepper.net/post/2010/04/15/Handling-ASPNet-Session-Variables.aspx#comment</comments>
      <guid isPermaLink="false">http://www.thewebpepper.net/post.aspx?id=e9849077-fa61-4f92-ab2f-2efaff80a96a</guid>
      <pubDate>Thu, 15 Apr 2010 18:11:00 +0500</pubDate>
      <category>ASP .Net</category>
      <category>C#</category>
      <dc:publisher>the WebNeck</dc:publisher>
      <pingback:server>http://www.thewebpepper.net/pingback.axd</pingback:server>
      <pingback:target>http://www.thewebpepper.net/post.aspx?id=e9849077-fa61-4f92-ab2f-2efaff80a96a</pingback:target>
      <slash:comments>0</slash:comments>
      <trackback:ping>http://www.thewebpepper.net/trackback.axd?id=e9849077-fa61-4f92-ab2f-2efaff80a96a</trackback:ping>
      <wfw:comment>http://www.thewebpepper.net/post/2010/04/15/Handling-ASPNet-Session-Variables.aspx#comment</wfw:comment>
      <wfw:commentRss>http://www.thewebpepper.net/syndication.axd?post=e9849077-fa61-4f92-ab2f-2efaff80a96a</wfw:commentRss>
    <feedburner:origLink>http://www.thewebpepper.net/post.aspx?id=e9849077-fa61-4f92-ab2f-2efaff80a96a</feedburner:origLink></item>
    <item>
      <title>FrameSet: Toggle the Content Area Size</title>
      <description>&lt;p&gt;Download Project:&amp;nbsp;&lt;a href="http://www.thewebpepper.net/file.axd?file=2010%2f4%2fWebPepperFrameset.zip"&gt;WebPepperFrameset.zip (5.47 kb)&lt;/a&gt;&lt;/p&gt;
&lt;h2&gt;Still Using Framesets?&lt;/h2&gt;
&lt;p&gt;Framesets were a valuable tool a few years back, but now, Master Pages are starting to take over this functionality. However, many sites still implement framesets and do not have the time to upgrade the entire site. So what we have here is a very simple way to toggle the size of the content area of with a very simple javascript function. The function will be placed on the page which defines the frameset and a button on one page within a frame.&lt;/p&gt;
&lt;p&gt;This will allow the user to focus in on what they are interested in without all the other clutter. Let's say it is a report and within this report the user can drill down to other linked reports to view the details, or it an item, a sketch, drawing that can be enlarged to view its detail. Whatever the case, it is so simple to do, you just may find this very handy.&lt;/p&gt;
&lt;h2&gt;We Start With This:&lt;/h2&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p align="center"&gt;&lt;img src="http://www.thewebpepper.net/image.axd?picture=2010%2f4%2fframeNormal.gif" alt="Normal View" /&gt;&lt;/p&gt;
&lt;h2&gt;Add the Javascript&lt;/h2&gt;
&lt;p&gt;The function Toggle() is added to the page defining the frameset: default.aspx&lt;/p&gt;
&lt;p&gt;&lt;!-- code formatted by http://manoli.net/csharpformat/ --&gt;&lt;/p&gt;
&lt;pre class="csharpcode"&gt;&amp;lt;%@ Page Language=&lt;span class="str"&gt;"C#"&lt;/span&gt; AutoEventWireup=&lt;span class="str"&gt;"true"&lt;/span&gt; CodeFile=&lt;span class="str"&gt;"default.aspx.cs"&lt;/span&gt; Inherits=&lt;span class="str"&gt;"ourNameSpace._default"&lt;/span&gt; %&amp;gt;
&amp;lt;!DOCTYPE html PUBLIC &lt;span class="str"&gt;"-//W3C//DTD XHTML 1.0 Frameset//EN"&lt;/span&gt; &lt;span class="str"&gt;"http://www.w3.org/TR/xhtml1/DTD/xhtml1-frameset.dtd"&lt;/span&gt;&amp;gt;

&amp;lt;html xmlns=&lt;span class="str"&gt;"http://www.w3.org/1999/xhtml"&lt;/span&gt; xmlns:lang=&lt;span class="str"&gt;"en"&lt;/span&gt; lang=&lt;span class="str"&gt;"en"&lt;/span&gt; &amp;gt;
&amp;lt;head runat=&lt;span class="str"&gt;"server"&lt;/span&gt;&amp;gt;
  &amp;lt;title&amp;gt;the WebPepper&amp;lt;/title&amp;gt;
  &amp;lt;script type=&lt;span class="str"&gt;'text/javascript'&lt;/span&gt;&amp;gt;

  function toggle(n) 
  {
    var fs1 = document.getElementById(&lt;span class="str"&gt;'fsPage'&lt;/span&gt;);
    var fs2 = document.getElementById(&lt;span class="str"&gt;'fsBody'&lt;/span&gt;);
    &lt;span class="kwrd"&gt;if&lt;/span&gt; (fs1)
    {
      &lt;span class="kwrd"&gt;if&lt;/span&gt; (fs1.rows == &lt;span class="str"&gt;"100,*,50"&lt;/span&gt;)  &lt;span class="rem"&gt;// "frHeader,fsBody,frFooter"&lt;/span&gt;
      {
        fs1.rows = &lt;span class="str"&gt;"23,*,0"&lt;/span&gt;;
        fs2.cols = &lt;span class="str"&gt;"0,*"&lt;/span&gt;;
        fs1.frameSpacing = &lt;span class="str"&gt;"1"&lt;/span&gt;
        fs2.frameSpacing = &lt;span class="str"&gt;"0"&lt;/span&gt;
      }
      &lt;span class="kwrd"&gt;else&lt;/span&gt; 
      {
        fs1.rows = &lt;span class="str"&gt;"100,*,50"&lt;/span&gt;;
        fs2.cols = &lt;span class="str"&gt;"275,*"&lt;/span&gt;;
        fs1.frameSpacing = &lt;span class="str"&gt;"3"&lt;/span&gt;
        fs2.frameSpacing = &lt;span class="str"&gt;"3"&lt;/span&gt;
      }
    }
  }

&amp;lt;/script&amp;gt;
&amp;lt;/head&amp;gt;

&amp;lt;frameset id=&lt;span class="str"&gt;"fsPage"&lt;/span&gt; rows=&lt;span class="str"&gt;"100,*,50"&lt;/span&gt; bordercolor=&lt;span class="str"&gt;"silver"&lt;/span&gt; framespacing=&lt;span class="str"&gt;"3"&lt;/span&gt;&amp;gt;
  &amp;lt;frame id=&lt;span class="str"&gt;"frHeader"&lt;/span&gt; src=&lt;span class="str"&gt;"ourHeader.aspx"&lt;/span&gt; runat=&lt;span class="str"&gt;"server"&lt;/span&gt; 
   frameborder=&lt;span class="str"&gt;"0"&lt;/span&gt; marginheight=&lt;span class="str"&gt;"0"&lt;/span&gt; marginwidth=&lt;span class="str"&gt;"0"&lt;/span&gt; noresize=&lt;span class="str"&gt;"noresize"&lt;/span&gt; scrolling=&lt;span class="str"&gt;"no"&lt;/span&gt; /&amp;gt;
  
  &amp;lt;frameset id=&lt;span class="str"&gt;"fsBody"&lt;/span&gt; cols=&lt;span class="str"&gt;"275,*"&lt;/span&gt; framespacing=&lt;span class="str"&gt;"3"&lt;/span&gt;&amp;gt;
    &amp;lt;frame id=&lt;span class="str"&gt;"frMenu"&lt;/span&gt; runat=&lt;span class="str"&gt;"server"&lt;/span&gt; src=&lt;span class="str"&gt;"ourMenu.aspx"&lt;/span&gt; 
     marginheight=&lt;span class="str"&gt;"0"&lt;/span&gt; marginwidth=&lt;span class="str"&gt;"0"&lt;/span&gt; frameborder=&lt;span class="str"&gt;"1"&lt;/span&gt; /&amp;gt;
    &amp;lt;frame id=&lt;span class="str"&gt;"frContent"&lt;/span&gt; runat=&lt;span class="str"&gt;"server"&lt;/span&gt; src=&lt;span class="str"&gt;"ourContent.aspx"&lt;/span&gt;
     marginheight=&lt;span class="str"&gt;"0"&lt;/span&gt; marginwidth=&lt;span class="str"&gt;"0"&lt;/span&gt; frameborder=&lt;span class="str"&gt;"1"&lt;/span&gt; bordercolor=&lt;span class="str"&gt;"silver"&lt;/span&gt; scrolling=&lt;span class="str"&gt;"auto"&lt;/span&gt; /&amp;gt;
  &amp;lt;/frameset&amp;gt;
      
  &amp;lt;frame id=&lt;span class="str"&gt;"frFooter"&lt;/span&gt; src=&lt;span class="str"&gt;"ourFooter.aspx"&lt;/span&gt; runat=&lt;span class="str"&gt;"server"&lt;/span&gt;
   frameborder=&lt;span class="str"&gt;"0"&lt;/span&gt; marginheight=&lt;span class="str"&gt;"0"&lt;/span&gt; marginwidth=&lt;span class="str"&gt;"0"&lt;/span&gt; noresize=&lt;span class="str"&gt;"noresize"&lt;/span&gt; scrolling=&lt;span class="str"&gt;"no"&lt;/span&gt;  /&amp;gt;
&amp;lt;/frameset&amp;gt;
&amp;lt;/html&amp;gt;
&lt;/pre&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;h2&gt;Add code to OnClientClick Event:&lt;/h2&gt;
&lt;p&gt;The button is added to the page which is the header: ourHeader.aspx&lt;/p&gt;
&lt;!-- code formatted by http://manoli.net/csharpformat/ --&gt;
&lt;pre class="csharpcode"&gt;
&amp;lt;asp:Button ID=&lt;span class="str"&gt;"Button1"&lt;/span&gt; runat=&lt;span class="str"&gt;"server"&lt;/span&gt; Text=&lt;span class="str"&gt;"Toggle Content Area"&lt;/span&gt; 
OnClientClick=&lt;span class="str"&gt;"javascript:parent.toggle(this)"&lt;/span&gt; /&amp;gt;

&lt;/pre&gt;
&lt;h2&gt;We Now Are Able To Show This:&lt;/h2&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p align="center"&gt;&lt;img src="http://www.thewebpepper.net/image.axd?picture=2010%2f4%2fframeExpanded.gif" alt="Frame Expanded" /&gt;&lt;/p&gt;
&lt;p&gt;Download Project:&amp;nbsp;&lt;a href="http://www.thewebpepper.net/file.axd?file=2010%2f4%2fWebPepperFrameset.zip"&gt;WebPepperFrameset.zip (5.47 kb)&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Hope this helps!&lt;/p&gt;
&lt;p&gt;&lt;!-- And... comments are always welcome, the good and the bad. --&gt;&lt;strong&gt;&lt;em&gt;the WebPepper team&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/theWebNeck/~4/DB1WEkN6x5o" height="1" width="1"/&gt;</description>
      <link>http://feedproxy.google.com/~r/theWebNeck/~3/DB1WEkN6x5o/post.aspx</link>
      <author>the WebNeck</author>
      <comments>http://www.thewebpepper.net/post/2010/04/13/FrameSet-Toggle-Content-Area-Size.aspx#comment</comments>
      <guid isPermaLink="false">http://www.thewebpepper.net/post.aspx?id=582a5833-92ab-45df-85b5-af22e0e6ce0a</guid>
      <pubDate>Tue, 13 Apr 2010 19:32:00 +0500</pubDate>
      <category>Javascript</category>
      <dc:publisher>the WebNeck</dc:publisher>
      <pingback:server>http://www.thewebpepper.net/pingback.axd</pingback:server>
      <pingback:target>http://www.thewebpepper.net/post.aspx?id=582a5833-92ab-45df-85b5-af22e0e6ce0a</pingback:target>
      <slash:comments>0</slash:comments>
      <trackback:ping>http://www.thewebpepper.net/trackback.axd?id=582a5833-92ab-45df-85b5-af22e0e6ce0a</trackback:ping>
      <wfw:comment>http://www.thewebpepper.net/post/2010/04/13/FrameSet-Toggle-Content-Area-Size.aspx#comment</wfw:comment>
      <wfw:commentRss>http://www.thewebpepper.net/syndication.axd?post=582a5833-92ab-45df-85b5-af22e0e6ce0a</wfw:commentRss>
    <feedburner:origLink>http://www.thewebpepper.net/post.aspx?id=582a5833-92ab-45df-85b5-af22e0e6ce0a</feedburner:origLink></item>
    <item>
      <title>Horizontal and Vertical Image Buttons with Rollover (CSS)</title>
      <description>&lt;p&gt;Download Project:&amp;nbsp;&lt;a href="http://www.thewebpepper.net/file.axd?file=2010%2f3%2fWebPepperButton.zip"&gt;WebPepperButton.zip (46.59 kb)&lt;/a&gt;&lt;/p&gt;
&lt;h2&gt;Horizontal and Vertical Image Button Lists using CSS&lt;/h2&gt;
&lt;p&gt;There is not much time devoted to this in the life-cycle of a project, but when you need to do it again, you probably ask yourself, "how did I do it?" In this sample project, we will provide the most commonly used ways of doing it within CSS. It is quite simple to markup, the toughest part is in the design of the graphics.&lt;/p&gt;
&lt;h2&gt;What's Covered:&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;Horizontal Layout&lt;/li&gt;
&lt;li&gt;Vertical Layout&lt;/li&gt;
&lt;li&gt;Images Only&lt;/li&gt;
&lt;li&gt;Images&amp;nbsp;with Text&lt;/li&gt;
&lt;li&gt;When to use Classes or ID's&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;We will use a single image for each button to show: default, hover and active (on-click) states. In order keep to things simple, &lt;span style="text-decoration: underline;"&gt;no&lt;/span&gt; events have been attached to the various states, that will be left up to you or possibly in a later post.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;div class="tip"&gt;&lt;strong&gt;Important Note:&lt;/strong&gt;&amp;nbsp;&amp;nbsp;The reasons for using a single image are: the images load quicker (reducing a possible flicker), less items to keep track of, using the same file name within the CSS and there are less items downloaded to the client.&lt;/div&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;h2&gt;the Horizontal Layout: Images Only&lt;/h2&gt;
&lt;p&gt;Let's start with this one, it's quite handy if you want to present a timed slide-show. Personally, I like to see the button image in the order of default, hover and then active, but with the [Stop] button image this is not true and it is shown in the css how to handle this.&lt;/p&gt;
&lt;p align="center"&gt;&lt;img src="http://www.thewebpepper.com/articleimages/Horizontal_Buttons.png" alt="Horizontal Screen Dump" /&gt;&lt;br /&gt;&lt;span style="font-size:8pt;"&gt;Horizontal Button List&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;Notice there are only 4 images: Back, Stop, Play and Forward. The [Back] and [Forward] buttons only have two states because that's all that is needed, the other two have three states (shown below). The default image of the [Stop] button is the 3&lt;sup&gt;rd&lt;/sup&gt; segment of the image, all the others are the 1&lt;sup&gt;st&lt;/sup&gt; segment.&lt;/p&gt;
&lt;p align="center"&gt;&lt;img src="http://www.thewebpepper.com/articleimages/Horizontal_Button_States.png" alt="Horizontal Screen Dump" /&gt;&lt;br /&gt;&lt;span style="font-size:8pt;"&gt;Button States&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;The Html markup, is simple. Here we set the unordered-list tag with a class [horizontal_list], because we may want to use more than one horizontal list on the page. Also, we define all div tags within each list-item by setting the IDs. By setting these IDs, we can only use these elements (our image buttons) once, otherwise we would need to use this Html markup within a user control.&lt;/p&gt;
&lt;!-- code formatted by http://manoli.net/csharpformat/ --&gt;
&lt;pre class="csharpcode"&gt;&lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;div&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;
  &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;ul&lt;/span&gt; &lt;span class="attr"&gt;class&lt;/span&gt;&lt;span class="kwrd"&gt;="horizontal_list"&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;
    &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;li&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;div&lt;/span&gt; &lt;span class="attr"&gt;id&lt;/span&gt;&lt;span class="kwrd"&gt;="back"&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;div&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;li&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;
    &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;li&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;div&lt;/span&gt; &lt;span class="attr"&gt;id&lt;/span&gt;&lt;span class="kwrd"&gt;="stop"&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;div&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;li&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;
    &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;li&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;div&lt;/span&gt; &lt;span class="attr"&gt;id&lt;/span&gt;&lt;span class="kwrd"&gt;="play"&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;div&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;li&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;
    &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;li&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;div&lt;/span&gt; &lt;span class="attr"&gt;id&lt;/span&gt;&lt;span class="kwrd"&gt;="forward"&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;div&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;li&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;
  &lt;span class="kwrd"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;ul&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;
&lt;span class="kwrd"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;div&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt; 
&lt;/pre&gt;
&lt;p&gt;The CSS, it's simple, too!&lt;/p&gt;
&lt;!-- code formatted by http://manoli.net/csharpformat/ --&gt;
&lt;pre class="csharpcode"&gt;ul { margin:0px; }
ul.horizontal_list li { display:inline; list-style:none; &lt;span class="kwrd"&gt;float&lt;/span&gt;:left; }

#back { background:url(&lt;span class="str"&gt;"images/back.png"&lt;/span&gt;) no-repeat 0 0; display:block; width:49px; height:51px; }
#back:active { background:url(&lt;span class="str"&gt;"images/back.png"&lt;/span&gt;) no-repeat 0 -51px; }

#stop { background:url(&lt;span class="str"&gt;"images/stop.png"&lt;/span&gt;) no-repeat 0 -102px; display:block; width:52px; height:51px; }
#stop:hover { background:url(&lt;span class="str"&gt;"images/stop.png"&lt;/span&gt;) no-repeat 0 -51px; }
#stop:active { background:url(&lt;span class="str"&gt;"images/stop.png"&lt;/span&gt;) no-repeat 0 0; }

#play { background:url(&lt;span class="str"&gt;"images/play.png"&lt;/span&gt;) no-repeat 0 0; display:block; width:49px; height:51px; }
#play:hover { background:url(&lt;span class="str"&gt;"images/play.png"&lt;/span&gt;) no-repeat 0 -51px; }
#play:active { background:url(&lt;span class="str"&gt;"images/play.png"&lt;/span&gt;) no-repeat 0 -102px; }

#forward { background:url(&lt;span class="str"&gt;"images/forward.png"&lt;/span&gt;) no-repeat 0 0; display:block; width:48px; height:51px; }
#forward:active { background:url(&lt;span class="str"&gt;"images/forward.png"&lt;/span&gt;) no-repeat 0 -51px; }
&lt;/pre&gt;
&lt;p&gt;Here is where we use image ID's, for the simple reason that each button has a different image and that this will only be displayed once on the page, if we needed multiple instances on the page, it would be a user control (*.ascx instead of being local to the page). Also, compare how the [Stop] button is different from the [Play] button, the third segment of the image vs the first.&lt;/p&gt;
&lt;p&gt;The height of the buttons are in this case 51px, and to represent each state (css tag {background: image-url repeat x-axis y-axis;} the y-axis is represented as a multiple of this 51px, measured from the top-down (0px as the base, and this why the values are: 0px, -51px and -102px)).&lt;/p&gt;
&lt;h2&gt;the Vertical Layout: Images with Text&lt;/h2&gt;
&lt;p&gt;Now we'll play with this one, it's quite handy if you want to present a menu. Here we use the same image over and over, and it can be used vertically or horizontally. The image has a border on all four sides, so to represent it in a vertical menu we'll shave-off the bottom border using css (setting the height to 20px instead of 21px). And since the image is used repeatably, this is the case for using a class instead of the ID's in the css.&lt;/p&gt;
&lt;p align="center"&gt;&lt;img src="http://www.thewebpepper.com/articleimages/Vertical_Buttons.png" alt="Vertical Screen Dump" /&gt;&lt;br /&gt;&lt;span style="font-size:8pt;"&gt;Vertical Button List&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;The image we are playing with is:&lt;/p&gt;
&lt;p align="center"&gt;&lt;img src="http://www.thewebpepper.com/articleimages/126x21.gif" alt="Vertical Image" /&gt;&lt;br /&gt;&lt;span style="font-size:8pt;"&gt;Button States&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;The Html markup, is simple too! Again we set the unordered-list tag with a class [vertical_list], because we may want to use more than one vertical list on the page and we use a wrapper and set the class to [vButtonWrapper].&lt;/p&gt;
&lt;!-- code formatted by http://manoli.net/csharpformat/ --&gt;
&lt;pre class="csharpcode"&gt;&lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;div&lt;/span&gt; &lt;span class="attr"&gt;class&lt;/span&gt;&lt;span class="kwrd"&gt;="vButtonWrapper"&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;
  &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;ul&lt;/span&gt; &lt;span class="attr"&gt;class&lt;/span&gt;&lt;span class="kwrd"&gt;="vertical_list"&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;
    &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;li&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;div&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;Home&lt;span class="kwrd"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;div&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;li&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;
    &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;li&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;div&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;Products&lt;span class="kwrd"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;div&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;li&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;
    &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;li&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;div&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;About Us&lt;span class="kwrd"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;div&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;li&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;
    &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;li&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;div&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;Support&lt;span class="kwrd"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;div&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;li&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;
  &lt;span class="kwrd"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;ul&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;
&lt;span class="kwrd"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;div&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt; 
&lt;/pre&gt;
&lt;p&gt;The CSS is very similar to the horizontal list, but:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Can you determine what makes this a vertical list?&lt;/li&gt;
&lt;li&gt;How would you make this a horizontal list?&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;Well, what makes it vertical is that the wrapper is set to the same width as the list-items and we did not use [float:left] attribute. In order to make this a horizontal list add [float:left;] to the [ul.vertical_list li] and change the [width:126px] of [.vButtonWrapper] to at least a multiple of a 126px, say greater than 504px (this would place all four items horizontally).&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;!-- code formatted by http://manoli.net/csharpformat/ --&gt;
&lt;pre class="csharpcode"&gt;body { font:arial; font-size:11px; font-family:Arial, Helvetica, sans-serif;}
ul.vertical_list li { text-align: left; margin-left:0; list-style:none; }

.vButtonWrapper { clear:both; width:126px; font-weight:bold; line-height:20px; }
div.vButtonWrapper div 
{ 
  background :url(&lt;span class="str"&gt;"images/126x21.gif"&lt;/span&gt;) no-repeat 0 0; display:block;
  width:126px; 
  height:20px; 
  text-align:center;
}
div.vButtonWrapper div:hover { background: url(&lt;span class="str"&gt;"images/126x21.gif"&lt;/span&gt;) no-repeat 0 -21px; }&lt;/pre&gt;
&lt;p&gt;Now, we're done! Wasn't that easy! Button On... folks!&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Small Bonus&lt;/strong&gt;: Within the Project Download, we include an Apple-like [Submit] button for you to play with. Even though the image is rectangular the graphic has rounded edges. You handle it in the same manner discussed above, but note it is on a transparent background so that the page background will show through and around the rounded edges. Images like this one are gif or png images... have fun!&lt;/p&gt;
&lt;p&gt;Download Project:&amp;nbsp;&lt;a href="http://www.thewebpepper.net/file.axd?file=2010%2f3%2fWebPepperButton.zip"&gt;WebPepperButton.zip (46.59 kb)&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Hope this helps!&lt;/p&gt;
&lt;p&gt;&lt;!-- And... comments are always welcome, the good and the bad. --&gt;&lt;strong&gt;&lt;em&gt;the WebPepper team&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/theWebNeck/~4/k0t3c8jKh7I" height="1" width="1"/&gt;</description>
      <link>http://feedproxy.google.com/~r/theWebNeck/~3/k0t3c8jKh7I/post.aspx</link>
      <author>the WebNeck</author>
      <comments>http://www.thewebpepper.net/post/2010/03/20/Horizontal-and-Vertical-Graphic-Buttons-with-Rollover-(CSS).aspx#comment</comments>
      <guid isPermaLink="false">http://www.thewebpepper.net/post.aspx?id=899e9647-29c9-491c-9e4f-307fb5cd2a24</guid>
      <pubDate>Sat, 20 Mar 2010 21:41:00 +0500</pubDate>
      <category>CSS</category>
      <dc:publisher>the WebNeck</dc:publisher>
      <pingback:server>http://www.thewebpepper.net/pingback.axd</pingback:server>
      <pingback:target>http://www.thewebpepper.net/post.aspx?id=899e9647-29c9-491c-9e4f-307fb5cd2a24</pingback:target>
      <slash:comments>0</slash:comments>
      <trackback:ping>http://www.thewebpepper.net/trackback.axd?id=899e9647-29c9-491c-9e4f-307fb5cd2a24</trackback:ping>
      <wfw:comment>http://www.thewebpepper.net/post/2010/03/20/Horizontal-and-Vertical-Graphic-Buttons-with-Rollover-(CSS).aspx#comment</wfw:comment>
      <wfw:commentRss>http://www.thewebpepper.net/syndication.axd?post=899e9647-29c9-491c-9e4f-307fb5cd2a24</wfw:commentRss>
    <feedburner:origLink>http://www.thewebpepper.net/post.aspx?id=899e9647-29c9-491c-9e4f-307fb5cd2a24</feedburner:origLink></item>
    <item>
      <title>TreeView (Part 2: Saving and Retrieving the Selection)</title>
      <description>&lt;p&gt;Download Project:&amp;nbsp;&lt;a href="http://www.thewebpepper.net/file.axd?file=2010%2f3%2fTreeview2.zip"&gt;Treeview2.zip (7.44 kb)&lt;/a&gt;&lt;/p&gt;
&lt;h2&gt;Visual Studio's TreeView Control w/Checkboxes&lt;/h2&gt;
&lt;p&gt;This will build upon Part 1: Multiple Select. Let us build in a way to save the user's selection and retrieve it. Is it easy? Of course!&lt;/p&gt;
&lt;h2&gt;Overview: Save, Open and Reset...&lt;/h2&gt;
&lt;p&gt;The objective in this part, is of course, to Save, Open and Reset the users selections. Also, when opening the user's saved selection, the tree will expand to the level showing all albums selected or not at the minimum and if only some tracks (or just one) of an album are selected, expand the tree branch (albums) to show all tracks selected or not.&lt;/p&gt;
&lt;p&gt;Why? Well, this tree does not have the capability of a tri-state checkbox which would show the user that only some of the child-nodes are selected for the branch. So, we need to set a condition where the tree expands one level above the deepest level as a default (at the very least) and expand the deepest level only if it is partially selected. This will show the user everything selected without having some selections hidden due to not having a tri-state checkbox.&lt;/p&gt;
&lt;p align="center"&gt;&lt;img style="border: 0px initial initial;" src="http://www.thewebpepper.com/articleimages/Cd Collection Result (pic1).png" alt="CD Collection Screen Dump" /&gt;&lt;br /&gt;To be able to open and show something like this.&lt;/p&gt;
&lt;div class="tip"&gt;&lt;strong&gt;Again to reiterate this Tip:&lt;/strong&gt;&amp;nbsp;&amp;nbsp;Since this Visual Studio Treeview control was thrown together without much finesse, the total number of items should be kept below ~700. One reason among several... upon rendering, it is a set of nested tables which are uncompressed which helps to make it slow, and to have more than 700 items even with a fast connection, performance  degrades exponentially. If your requirements are to exceed 700 items (and mine did) you should consider purchasing a third party control, I chose one from EssentialObjects, cheap, fast, with a multitude of built-in options, plus you can easily leverage dynamic loading.  &lt;br /&gt;&lt;br /&gt;&lt;em&gt;And not that it matters, my CD collection exceeds well over 700 albums... !!!&lt;/em&gt;&lt;/div&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;h2&gt;Ok, some re-work... it's only to comment one line of code&lt;/h2&gt;
&lt;p&gt;Where? In the user control for the tree view, to be honest it was a poor choice to define the default XmlDataSource there, anyway it is shown below within the file [ucTree.ascx.cs]:&lt;/p&gt;
&lt;p&gt;&lt;!-- code formatted by http://manoli.net/csharpformat/ --&gt;&lt;/p&gt;
&lt;pre class="csharpcode"&gt;  &lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;partial&lt;/span&gt; &lt;span class="kwrd"&gt;class&lt;/span&gt; ucTree : System.Web.UI.UserControl
  {
    &lt;span class="kwrd"&gt;protected&lt;/span&gt; &lt;span class="kwrd"&gt;void&lt;/span&gt; Page_Load(&lt;span class="kwrd"&gt;object&lt;/span&gt; sender, EventArgs e)
    {
      &lt;span class="rem"&gt;//XmlDataSource1.DataFile = "~/App_Data/Music.xml";&lt;/span&gt;
      cdT.Attributes.Add(&lt;span class="str"&gt;"onclick"&lt;/span&gt;, &lt;span class="str"&gt;"OnCheckBoxCheckChanged(event)"&lt;/span&gt;);
    }
&lt;/pre&gt;
&lt;p&gt;and we will move it to page which implements the user control [pgTree.aspx.cs]&lt;/p&gt;
&lt;p&gt;&lt;!-- code formatted by http://manoli.net/csharpformat/ --&gt;&lt;/p&gt;
&lt;pre class="csharpcode"&gt;  &lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;partial&lt;/span&gt; &lt;span class="kwrd"&gt;class&lt;/span&gt; pgTree : System.Web.UI.Page
  {
    &lt;span class="kwrd"&gt;protected&lt;/span&gt; &lt;span class="kwrd"&gt;void&lt;/span&gt; Page_Load(&lt;span class="kwrd"&gt;object&lt;/span&gt; sender, EventArgs e)
    {
      &lt;span class="kwrd"&gt;if&lt;/span&gt; (!IsPostBack)
      {
        XmlDataSource xds = cdT1.FindControl(&lt;span class="str"&gt;"XmlDataSource1"&lt;/span&gt;) &lt;span class="kwrd"&gt;as&lt;/span&gt; XmlDataSource;
        xds.DataFile = &lt;span class="str"&gt;"~/App_Data/Music.xml"&lt;/span&gt;;
      }
    }
&lt;/pre&gt;
&lt;p&gt;Yes, it is replaced by 2 lines of code, because the xmldatasource is within the user control, need to find the correct control within the user control...&lt;/p&gt;
&lt;h2&gt;Page (Html-Markup):&amp;nbsp;pgTree.aspx&lt;/h2&gt;
&lt;p&gt;Here we are to add 4 controls: a textbox to save and retrieve file settings and 3 buttons to Save, Open and Reset the treeview. Notice that are OnClick events attached to the buttons.&lt;/p&gt;
&lt;p&gt;&lt;!-- code formatted by http://manoli.net/csharpformat/ --&gt;&lt;/p&gt;
&lt;pre class="csharpcode"&gt;&lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;form&lt;/span&gt; &lt;span class="attr"&gt;id&lt;/span&gt;&lt;span class="kwrd"&gt;="submitform"&lt;/span&gt; &lt;span class="attr"&gt;name&lt;/span&gt;&lt;span class="kwrd"&gt;="mainform"&lt;/span&gt; &lt;span class="attr"&gt;method&lt;/span&gt;&lt;span class="kwrd"&gt;="post"&lt;/span&gt; &lt;span class="attr"&gt;runat&lt;/span&gt;&lt;span class="kwrd"&gt;="server"&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;
    &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;div&lt;/span&gt; &lt;span class="attr"&gt;id&lt;/span&gt;&lt;span class="kwrd"&gt;="tabs-1"&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;
    &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;asp:label&lt;/span&gt; &lt;span class="attr"&gt;id&lt;/span&gt;&lt;span class="kwrd"&gt;="Label1"&lt;/span&gt; &lt;span class="attr"&gt;runat&lt;/span&gt;&lt;span class="kwrd"&gt;="server"&lt;/span&gt; &lt;span class="attr"&gt;Text&lt;/span&gt;&lt;span class="kwrd"&gt;="CD's in a TreeView"&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;asp:label&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;    
    &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;uc1:ucT&lt;/span&gt; &lt;span class="attr"&gt;id&lt;/span&gt;&lt;span class="kwrd"&gt;="cdT1"&lt;/span&gt; &lt;span class="attr"&gt;runat&lt;/span&gt;&lt;span class="kwrd"&gt;="server"&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;uc1:ucT&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;
    &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;asp:TextBox&lt;/span&gt; &lt;span class="attr"&gt;ID&lt;/span&gt;&lt;span class="kwrd"&gt;="TextBox1"&lt;/span&gt; &lt;span class="attr"&gt;runat&lt;/span&gt;&lt;span class="kwrd"&gt;="server"&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;asp:TextBox&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;
    &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;asp:Button&lt;/span&gt; &lt;span class="attr"&gt;ID&lt;/span&gt;&lt;span class="kwrd"&gt;="Button1"&lt;/span&gt; &lt;span class="attr"&gt;runat&lt;/span&gt;&lt;span class="kwrd"&gt;="server"&lt;/span&gt; &lt;span class="attr"&gt;Text&lt;/span&gt;&lt;span class="kwrd"&gt;="Save"&lt;/span&gt;  &lt;span class="attr"&gt;OnClick&lt;/span&gt;&lt;span class="kwrd"&gt;="Save"&lt;/span&gt; &lt;span class="kwrd"&gt;/&amp;gt;&lt;/span&gt;
    &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;asp:Button&lt;/span&gt; &lt;span class="attr"&gt;ID&lt;/span&gt;&lt;span class="kwrd"&gt;="Button2"&lt;/span&gt; &lt;span class="attr"&gt;runat&lt;/span&gt;&lt;span class="kwrd"&gt;="server"&lt;/span&gt; &lt;span class="attr"&gt;Text&lt;/span&gt;&lt;span class="kwrd"&gt;="Open"&lt;/span&gt;  &lt;span class="attr"&gt;OnClick&lt;/span&gt;&lt;span class="kwrd"&gt;="Open"&lt;/span&gt;&lt;span class="kwrd"&gt;/&amp;gt;&lt;/span&gt;
    &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;asp:Button&lt;/span&gt; &lt;span class="attr"&gt;ID&lt;/span&gt;&lt;span class="kwrd"&gt;="Button3"&lt;/span&gt; &lt;span class="attr"&gt;runat&lt;/span&gt;&lt;span class="kwrd"&gt;="server"&lt;/span&gt; &lt;span class="attr"&gt;Text&lt;/span&gt;&lt;span class="kwrd"&gt;="Reset"&lt;/span&gt; &lt;span class="attr"&gt;OnClick&lt;/span&gt;&lt;span class="kwrd"&gt;="Reset"&lt;/span&gt;&lt;span class="kwrd"&gt;/&amp;gt;&lt;/span&gt;
  &lt;span class="kwrd"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;div&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;
&lt;span class="kwrd"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;form&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;
&lt;/pre&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;h2&gt;Save:&amp;nbsp;(Server-Side) pgTree.aspx.cs&lt;/h2&gt;
&lt;p&gt;First, need to check if the user entered a file name (don't need the extension, its set to be xml). If so, then continue, finding the control within the user control, the path to our [App_Data] folder and launch the XmlTextWriter.&lt;/p&gt;
&lt;p&gt;After starting the XmlTextWriter we call the function CollectIt(), which is a re-iterative process to traverse the contents of the treeview from the top down. Now this is what we will be saving:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Renaming the element name and the depth: Level0='All Rock Music', Level1='Band' and so forth...&lt;/li&gt;
&lt;li&gt;Write the attribute "ItemNo" and it's value from the node (our key or the index of unique values).&lt;/li&gt;
&lt;li&gt;And write another attribute "checked" to denote whether the node was selected or not.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;!-- code formatted by http://manoli.net/csharpformat/ --&gt;&lt;/p&gt;
&lt;pre class="csharpcode"&gt;    &lt;span class="rem"&gt;// Handle Save: *******************************************************************&lt;/span&gt;
    &lt;span class="kwrd"&gt;protected&lt;/span&gt; &lt;span class="kwrd"&gt;void&lt;/span&gt; Save(&lt;span class="kwrd"&gt;object&lt;/span&gt; sender, System.EventArgs e)
    {
      &lt;span class="kwrd"&gt;if&lt;/span&gt; (TextBox1.Text == &lt;span class="str"&gt;""&lt;/span&gt;) { MessageBox(&lt;span class="str"&gt;"Error: Need a file name."&lt;/span&gt;); &lt;span class="kwrd"&gt;return&lt;/span&gt;; }

      TreeView Tree = &lt;span class="kwrd"&gt;new&lt;/span&gt; TreeView();
      Tree = cdT1.FindControl(&lt;span class="str"&gt;"cdT"&lt;/span&gt;) &lt;span class="kwrd"&gt;as&lt;/span&gt; TreeView;
      TreeNodeCollection treeNodes = Tree.Nodes &lt;span class="kwrd"&gt;as&lt;/span&gt; TreeNodeCollection;

      &lt;span class="kwrd"&gt;string&lt;/span&gt; tmpPath = Server.MapPath(&lt;span class="str"&gt;"./App_Data/"&lt;/span&gt;); &lt;span class="rem"&gt;//to get a handle on a virtual folder&lt;/span&gt;
      &lt;span class="kwrd"&gt;string&lt;/span&gt; filename = tmpPath + TextBox1.Text + &lt;span class="str"&gt;".XML"&lt;/span&gt;;

      XmlTextWriter tw = &lt;span class="kwrd"&gt;new&lt;/span&gt; XmlTextWriter(filename, System.Text.Encoding.Unicode);
      tw.WriteStartDocument();
      collectIt(treeNodes, tw);
      tw.WriteEndDocument();
      tw.Close();
    }
    &lt;span class="kwrd"&gt;private&lt;/span&gt; &lt;span class="kwrd"&gt;void&lt;/span&gt; collectIt(TreeNodeCollection treeNodes, XmlTextWriter textWriter)
    {
      &lt;span class="kwrd"&gt;foreach&lt;/span&gt; (TreeNode node &lt;span class="kwrd"&gt;in&lt;/span&gt; treeNodes)
      {
        textWriter.WriteStartElement(&lt;span class="str"&gt;"Level"&lt;/span&gt; + node.Depth.ToString());
        textWriter.WriteAttributeString(&lt;span class="str"&gt;"ItemNo"&lt;/span&gt;, node.Value);
        textWriter.WriteAttributeString(&lt;span class="str"&gt;"checked"&lt;/span&gt;, node.Checked.ToString());
        &lt;span class="kwrd"&gt;if&lt;/span&gt; (node.ChildNodes.Count &amp;gt; 0) { collectIt(node.ChildNodes, textWriter); }
        textWriter.WriteEndElement();
      }
    }
    &lt;span class="rem"&gt;// ********************************************************************************&lt;/span&gt;
&lt;/pre&gt;
&lt;p&gt;An example of what is saved:&lt;/p&gt;
&lt;p&gt;&lt;!-- code formatted by http://manoli.net/csharpformat/ --&gt;&lt;/p&gt;
&lt;pre class="csharpcode"&gt;&lt;span class="kwrd"&gt;&amp;lt;?&lt;/span&gt;&lt;span class="html"&gt;xml&lt;/span&gt; &lt;span class="attr"&gt;version&lt;/span&gt;&lt;span class="kwrd"&gt;="1.0"&lt;/span&gt; &lt;span class="attr"&gt;encoding&lt;/span&gt;&lt;span class="kwrd"&gt;="utf-16"&lt;/span&gt;?&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;
&lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;Level0&lt;/span&gt; &lt;span class="attr"&gt;ItemNo&lt;/span&gt;&lt;span class="kwrd"&gt;="0"&lt;/span&gt; &lt;span class="attr"&gt;checked&lt;/span&gt;&lt;span class="kwrd"&gt;="False"&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;
  &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;Level1&lt;/span&gt; &lt;span class="attr"&gt;ItemNo&lt;/span&gt;&lt;span class="kwrd"&gt;="101.0"&lt;/span&gt; &lt;span class="attr"&gt;checked&lt;/span&gt;&lt;span class="kwrd"&gt;="False"&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;
    &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;Level2&lt;/span&gt; &lt;span class="attr"&gt;ItemNo&lt;/span&gt;&lt;span class="kwrd"&gt;="101.1"&lt;/span&gt; &lt;span class="attr"&gt;checked&lt;/span&gt;&lt;span class="kwrd"&gt;="True"&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;
      &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;Level3&lt;/span&gt; &lt;span class="attr"&gt;ItemNo&lt;/span&gt;&lt;span class="kwrd"&gt;="101.101"&lt;/span&gt; &lt;span class="attr"&gt;checked&lt;/span&gt;&lt;span class="kwrd"&gt;="True"&lt;/span&gt; &lt;span class="kwrd"&gt;/&amp;gt;&lt;/span&gt;
      &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;Level3&lt;/span&gt; &lt;span class="attr"&gt;ItemNo&lt;/span&gt;&lt;span class="kwrd"&gt;="101.102"&lt;/span&gt; &lt;span class="attr"&gt;checked&lt;/span&gt;&lt;span class="kwrd"&gt;="True"&lt;/span&gt; &lt;span class="kwrd"&gt;/&amp;gt;&lt;/span&gt;
      &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;Level3&lt;/span&gt; &lt;span class="attr"&gt;ItemNo&lt;/span&gt;&lt;span class="kwrd"&gt;="101.103"&lt;/span&gt; &lt;span class="attr"&gt;checked&lt;/span&gt;&lt;span class="kwrd"&gt;="True"&lt;/span&gt; &lt;span class="kwrd"&gt;/&amp;gt;&lt;/span&gt;&lt;br /&gt;etc...&lt;/pre&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;h2&gt;Open:&amp;nbsp;(Server-Side) pgTree.aspx.cs&lt;/h2&gt;
&lt;p&gt;Here we doing some basic error checking, if the user entered a filename and if it exists. Again we grab the handle to the treeview and open the saved file. Notice that we first collapse all the branches and then expand the branch if it is at the first or second level (Level0-root and Level1-Band) and then only expand the third level (Level2-Album) only if the parent node of Level3-Track (parent node here would be Level2-Album) is unchecked. Similar to the CollectIt() function above, the SetIt() function is also a re-iterative one, transversing the tree from the top down.&lt;/p&gt;
&lt;p&gt;&lt;!-- code formatted by http://manoli.net/csharpformat/ --&gt;&lt;/p&gt;
&lt;pre class="csharpcode"&gt;    &lt;span class="rem"&gt;// Handle Open: *******************************************************************&lt;/span&gt;
    &lt;span class="kwrd"&gt;protected&lt;/span&gt; &lt;span class="kwrd"&gt;void&lt;/span&gt; Open(&lt;span class="kwrd"&gt;object&lt;/span&gt; sender, System.EventArgs e)
    {
      &lt;span class="kwrd"&gt;if&lt;/span&gt; (TextBox1.Text == &lt;span class="str"&gt;""&lt;/span&gt;) { MessageBox(&lt;span class="str"&gt;"Error: Need a file name."&lt;/span&gt;); &lt;span class="kwrd"&gt;return&lt;/span&gt;; }
      TreeView Tree = &lt;span class="kwrd"&gt;new&lt;/span&gt; TreeView();
      Tree = cdT1.FindControl(&lt;span class="str"&gt;"cdT"&lt;/span&gt;) &lt;span class="kwrd"&gt;as&lt;/span&gt; TreeView;
      TreeNodeCollection treeNodes = Tree.Nodes &lt;span class="kwrd"&gt;as&lt;/span&gt; TreeNodeCollection;
      Tree.CollapseAll();

      &lt;span class="kwrd"&gt;string&lt;/span&gt; tmpPath = Server.MapPath(&lt;span class="str"&gt;"./App_Data/"&lt;/span&gt;); &lt;span class="rem"&gt;//to get a handle on a virtual folder&lt;/span&gt;
      &lt;span class="kwrd"&gt;string&lt;/span&gt; filename = tmpPath + TextBox1.Text + &lt;span class="str"&gt;".XML"&lt;/span&gt;;
      &lt;span class="kwrd"&gt;if&lt;/span&gt; (!File.Exists(filename)) { MessageBox(&lt;span class="str"&gt;"Error: File does not exist."&lt;/span&gt;); &lt;span class="kwrd"&gt;return&lt;/span&gt;; }

      XmlTextReader tr = &lt;span class="kwrd"&gt;new&lt;/span&gt; XmlTextReader(filename);

      &lt;span class="kwrd"&gt;using&lt;/span&gt; (XmlReader reader = XmlReader.Create(filename))
      {
        &lt;span class="kwrd"&gt;while&lt;/span&gt; (reader.Read())
        {
           &lt;span class="rem"&gt;// Only detect start elements, going to ignore anything else&lt;/span&gt;
          &lt;span class="kwrd"&gt;if&lt;/span&gt; (reader.IsStartElement())
          {
            setIt(treeNodes, reader.Depth, reader[&lt;span class="str"&gt;"ItemNo"&lt;/span&gt;], reader[&lt;span class="str"&gt;"checked"&lt;/span&gt;]);
          }
        }
      }
    }
    &lt;span class="kwrd"&gt;private&lt;/span&gt; &lt;span class="kwrd"&gt;void&lt;/span&gt; setIt(TreeNodeCollection treeNodes, &lt;span class="kwrd"&gt;int&lt;/span&gt; x, &lt;span class="kwrd"&gt;string&lt;/span&gt; strItemNo, &lt;span class="kwrd"&gt;string&lt;/span&gt; strChecked)
    {
      &lt;span class="kwrd"&gt;foreach&lt;/span&gt; (TreeNode node &lt;span class="kwrd"&gt;in&lt;/span&gt; treeNodes)
      {
        &lt;span class="kwrd"&gt;if&lt;/span&gt; (node.Depth == x &amp;amp;&amp;amp; node.Value == strItemNo) 
        {
          &lt;span class="kwrd"&gt;switch&lt;/span&gt; (node.Depth)
          {
            &lt;span class="kwrd"&gt;case&lt;/span&gt; 0: node.Expand(); &lt;span class="kwrd"&gt;break&lt;/span&gt;;
            &lt;span class="kwrd"&gt;case&lt;/span&gt; 1: node.Expand(); &lt;span class="kwrd"&gt;break&lt;/span&gt;;
            &lt;span class="kwrd"&gt;default&lt;/span&gt;:
              &lt;span class="kwrd"&gt;if&lt;/span&gt; (strChecked == &lt;span class="str"&gt;"True"&lt;/span&gt; &amp;amp;&amp;amp; node.Parent.Checked != &lt;span class="kwrd"&gt;true&lt;/span&gt;) { node.Parent.Expand(); }
              &lt;span class="kwrd"&gt;break&lt;/span&gt;;
          }
          node.Checked = System.Convert.ToBoolean(strChecked);
          &lt;span class="kwrd"&gt;return&lt;/span&gt;;
        }
        &lt;span class="kwrd"&gt;if&lt;/span&gt; (node.ChildNodes.Count &amp;gt; 0) { setIt(node.ChildNodes, x, strItemNo, strChecked); }
      }
    }
    &lt;span class="rem"&gt;// ********************************************************************************&lt;/span&gt;
&lt;/pre&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;h2&gt;Reset:&amp;nbsp;(Server-Side) pgTree.aspx.cs&lt;/h2&gt;
&lt;p&gt;This function is nearly identical to the open function except we not opening any file. We are just checking all nodes and expanding only the first 2 levels of the tree.&lt;/p&gt;
&lt;p&gt;&lt;!-- code formatted by http://manoli.net/csharpformat/ --&gt;&lt;/p&gt;
&lt;pre class="csharpcode"&gt;    &lt;span class="rem"&gt;// Handle Reset: ******************************************************************&lt;/span&gt;
    &lt;span class="kwrd"&gt;protected&lt;/span&gt; &lt;span class="kwrd"&gt;void&lt;/span&gt; Reset(&lt;span class="kwrd"&gt;object&lt;/span&gt; sender, System.EventArgs e)
    {
      TreeView Tree = &lt;span class="kwrd"&gt;new&lt;/span&gt; TreeView();
      Tree = cdT1.FindControl(&lt;span class="str"&gt;"cdT"&lt;/span&gt;) &lt;span class="kwrd"&gt;as&lt;/span&gt; TreeView;
      TreeNodeCollection treeNodes = Tree.Nodes &lt;span class="kwrd"&gt;as&lt;/span&gt; TreeNodeCollection;
      Tree.CollapseAll();

      &lt;span class="kwrd"&gt;foreach&lt;/span&gt; (TreeNode node &lt;span class="kwrd"&gt;in&lt;/span&gt; treeNodes) { &lt;span class="kwrd"&gt;this&lt;/span&gt;.CheckNodes(&lt;span class="kwrd"&gt;true&lt;/span&gt;, node); }
    }
    &lt;span class="kwrd"&gt;private&lt;/span&gt; &lt;span class="kwrd"&gt;void&lt;/span&gt; CheckNodes(&lt;span class="kwrd"&gt;bool&lt;/span&gt; check, TreeNode node)
    {
      node.Checked = check;
      &lt;span class="kwrd"&gt;foreach&lt;/span&gt; (TreeNode child &lt;span class="kwrd"&gt;in&lt;/span&gt; node.ChildNodes)
      {
        &lt;span class="kwrd"&gt;if&lt;/span&gt; (node.Depth &amp;lt;= 1) { node.Expand(); }
        &lt;span class="kwrd"&gt;if&lt;/span&gt; (child.ChildNodes.Count &amp;gt;= 0) { CheckNodes(check, child); }
      }
    }
    &lt;span class="rem"&gt;// ********************************************************************************&lt;/span&gt;
&lt;/pre&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;div class="tip"&gt;&lt;strong&gt;Important Note:&lt;/strong&gt;&amp;nbsp;&amp;nbsp;This sample project &lt;strong&gt;does not&lt;/strong&gt; take into account the additions and/or deletions made to the original treeview (Music.xml). The saved files would then be out of date and the treeview will only reflect the values which were saved and still valid within Music.xml. &lt;br /&gt;&lt;br /&gt; Also, we could have just added the 'checked' attribute to Music.xml and saved it with another file name and only show the info of what was saved. But then you still have to find a way to update the listing. The approach taken here is to show you in such a way that you know what is original and what was saved by reviewing the xml files themselves. Oh, make sure to add-in a safeguard so you won't overwrite your original!  &lt;br /&gt;&lt;br /&gt; We'll leave this up to you to handle, but now you have the basic tools to take it further...&lt;/div&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Download Project:&amp;nbsp;&lt;a href="http://www.thewebpepper.net/file.axd?file=2010%2f3%2fTreeview2.zip"&gt;Treeview2.zip (7.44 kb)&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;!-- And... comments are always welcome, the good and the bad. --&gt;&lt;strong&gt;&lt;em&gt;the WebPepper team&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/theWebNeck/~4/gssPS2-2Wjs" height="1" width="1"/&gt;</description>
      <link>http://feedproxy.google.com/~r/theWebNeck/~3/gssPS2-2Wjs/post.aspx</link>
      <author>the WebNeck</author>
      <comments>http://www.thewebpepper.net/post/2010/03/09/TreeView-(Part-2-Multiple-Select).aspx#comment</comments>
      <guid isPermaLink="false">http://www.thewebpepper.net/post.aspx?id=8c90c6f4-7bea-437c-824e-78abad984b51</guid>
      <pubDate>Tue, 09 Mar 2010 03:50:00 +0500</pubDate>
      <category>ASP .Net</category>
      <category>C#</category>
      <dc:publisher>the WebNeck</dc:publisher>
      <pingback:server>http://www.thewebpepper.net/pingback.axd</pingback:server>
      <pingback:target>http://www.thewebpepper.net/post.aspx?id=8c90c6f4-7bea-437c-824e-78abad984b51</pingback:target>
      <slash:comments>0</slash:comments>
      <trackback:ping>http://www.thewebpepper.net/trackback.axd?id=8c90c6f4-7bea-437c-824e-78abad984b51</trackback:ping>
      <wfw:comment>http://www.thewebpepper.net/post/2010/03/09/TreeView-(Part-2-Multiple-Select).aspx#comment</wfw:comment>
      <wfw:commentRss>http://www.thewebpepper.net/syndication.axd?post=8c90c6f4-7bea-437c-824e-78abad984b51</wfw:commentRss>
    <feedburner:origLink>http://www.thewebpepper.net/post.aspx?id=8c90c6f4-7bea-437c-824e-78abad984b51</feedburner:origLink></item>
    <item>
      <title>TreeView (Part 1: Multiple Select)</title>
      <description>&lt;p&gt;Download Project:&amp;nbsp;&lt;a href="http://www.thewebpepper.net/file.axd?file=2010%2f3%2fTreeview.zip"&gt;Treeview.zip (6.31 kb)&lt;/a&gt;&lt;/p&gt;
&lt;h2&gt;Visual Studio's TreeView Control w/Checkboxes&lt;/h2&gt;
&lt;p&gt;The TreeView control is a great control that allows the user to drill-down through a hierarchy of items and make a selection. But, how easy is it to set it up for a multiple selection? This too, is easy...&lt;/p&gt;

&lt;h2&gt;This control is quite basic (plan vanilla)...&lt;/h2&gt;
&lt;p&gt;Even though it can be found in Visual Studio's tool box on the Navigation tab, alot of work needs to be done if you want to implement checkboxes but provided as part of the download. This control is incomplete for something that is part Visual Studio but since there are no additional licenses to purchase, let's make it work. The example will use an Xml file of a small CD collection of rock music so that you can select/unselect all music, an artist/band, an album or individual tunes with a single click.&lt;/p&gt;
&lt;p&gt;The control will open up (expand) to show all albums in the collection and show all music as selected. The treeview will be implemented as a simple user control to be placed on a page. The xml data file will reside in the [App_Data] folder which is set with read/write permissions (we may want to save and retrieve those different selections, more on that later). Also, a javascript file is linked in for client-side event handling, this part was authored by: &lt;a style="color:black; text-decoration:underline;" rel="nofollow" href="http://codeasp.net/articles/asp.net/34/updated-asp.net-treeview-checkboxes-check-all-javascript" target="_blank"&gt;ranganh&lt;/a&gt; (visit this link for info), which does most of the real work.&lt;/p&gt;

&lt;p align="center"&gt;&lt;img style="border: 0px initial initial;" src="http://www.thewebpepper.com/articleimages/Cd Collection (pic1).png" alt="CD Collection Screen Dump" /&gt;&lt;br /&gt;Opening Page&lt;/p&gt;

&lt;p&gt;&lt;div class="tip"&gt;&lt;strong&gt;Tip:&lt;/strong&gt;&amp;nbsp;&amp;nbsp;Since this Visual Studio Treeview control was thrown together without much finesse, the total number of items should be kept below ~700.  One reason among several... upon rendering, it is a set of nested tables which are uncompressed which helps to make it slow, and to have more than 700 items even with a fast connection, performance  degrades exponentially. If your requirements are to exceed 700 items (and mine did) you should consider purchasing a third party control, I chose one from EssentialObjects, cheap, fast, with a multitude of built-in options, plus you can easily leverage dynamic loading.&lt;/div&gt;&lt;/p&gt;

&lt;h2&gt;User Control (html-markup): ucTree.ascx&lt;/h2&gt;
&lt;p&gt;Within this user control, we use the the treeview and the xmldatasource controls and define the defaults. Notice that ExpandDepth="2" in order to expand all the branches down to the albums.&lt;/p&gt;

&lt;p&gt;&lt;!-- code formatted by http://manoli.net/csharpformat/ --&gt;
&lt;pre class="csharpcode"&gt;
&lt;span class="asp"&gt;&amp;lt;%@ Control Language="c#" Inherits="cdTree.ucTree" CodeFile="ucTree.ascx.cs" %&amp;gt;&lt;/span&gt;
&lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;table&lt;/span&gt; &lt;span class="attr"&gt;cellspacing&lt;/span&gt;&lt;span class="kwrd"&gt;="0"&lt;/span&gt; &lt;span class="attr"&gt;cellpadding&lt;/span&gt;&lt;span class="kwrd"&gt;="2"&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;
  &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;tr&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;
    &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;td&lt;/span&gt; &lt;span class="attr"&gt;class&lt;/span&gt;&lt;span class="kwrd"&gt;="R_GroupHeading"&lt;/span&gt; &lt;span class="attr"&gt;align&lt;/span&gt;&lt;span class="kwrd"&gt;="left"&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;
      &lt;span class="attr"&gt;&amp;amp;nbsp;&lt;/span&gt;Some of my CD's
    &lt;span class="kwrd"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;td&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;
  &lt;span class="kwrd"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;tr&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;
  &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;tr&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;
    &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;td&lt;/span&gt; &lt;span class="attr"&gt;align&lt;/span&gt;&lt;span class="kwrd"&gt;="left"&lt;/span&gt; &lt;span class="attr"&gt;style&lt;/span&gt;&lt;span class="kwrd"&gt;="border:solid 1px silver;"&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;
      &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;div&lt;/span&gt; &lt;span class="attr"&gt;class&lt;/span&gt;&lt;span class="kwrd"&gt;="R_Data"&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;
        &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;asp:TreeView&lt;/span&gt; &lt;span class="attr"&gt;ID&lt;/span&gt;&lt;span class="kwrd"&gt;="cdT"&lt;/span&gt; &lt;span class="attr"&gt;SkinId&lt;/span&gt;&lt;span class="kwrd"&gt;="cdSkin"&lt;/span&gt; &lt;span class="attr"&gt;runat&lt;/span&gt;&lt;span class="kwrd"&gt;="server"&lt;/span&gt; &lt;span class="attr"&gt;DataSourceID&lt;/span&gt;&lt;span class="kwrd"&gt;="XmlDataSource1"&lt;/span&gt;
          &lt;span class="attr"&gt;OnPreRender&lt;/span&gt;&lt;span class="kwrd"&gt;="cdTree_OnPreRender"&lt;/span&gt; &lt;span class="attr"&gt;ShowCheckBoxes&lt;/span&gt;&lt;span class="kwrd"&gt;="All"&lt;/span&gt; &lt;span class="attr"&gt;ExpandDepth&lt;/span&gt;&lt;span class="kwrd"&gt;="2"&lt;/span&gt;  &lt;span class="attr"&gt;ShowLines&lt;/span&gt;&lt;span class="kwrd"&gt;="true"&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;
          &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;DataBindings&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;
            &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;asp:TreeNodeBinding&lt;/span&gt; &lt;span class="attr"&gt;TextField&lt;/span&gt;&lt;span class="kwrd"&gt;="Title"&lt;/span&gt; &lt;span class="attr"&gt;ValueField&lt;/span&gt;&lt;span class="kwrd"&gt;="ItemNo"&lt;/span&gt; &lt;span class="kwrd"&gt;/&amp;gt;&lt;/span&gt;
          &lt;span class="kwrd"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;DataBindings&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;
        &lt;span class="kwrd"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;asp:TreeView&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;
        &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;asp:XmlDataSource&lt;/span&gt; &lt;span class="attr"&gt;ID&lt;/span&gt;&lt;span class="kwrd"&gt;="XmlDataSource1"&lt;/span&gt; &lt;span class="attr"&gt;runat&lt;/span&gt;&lt;span class="kwrd"&gt;="server"&lt;/span&gt; &lt;span class="kwrd"&gt;&amp;gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;asp:XmlDataSource&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;
      &lt;span class="kwrd"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;div&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;
    &lt;span class="kwrd"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;td&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;
  &lt;span class="kwrd"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;tr&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;
&lt;span class="kwrd"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;table&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;&lt;/pre&gt;&lt;/p&gt;

&lt;h2&gt;User Control (server-side): ucTree.ascx.cs&lt;/h2&gt;
&lt;p&gt;On Page_Load (the function that fires first here) is where the data source is defined and where we attach the OnClick event-handler to the treeview, which fires code in the client-side javascript. OnPreRender, the function which fires next, loops through all the treenodes to set the checkboxes. This is a re-iterative process following line by line in the xml (file shown below).&lt;/p&gt;
&lt;p&gt;&lt;!-- code formatted by http://manoli.net/csharpformat/ --&gt;
&lt;pre class="csharpcode"&gt;
&lt;span class="kwrd"&gt;namespace&lt;/span&gt; cdTree
{
  &lt;span class="kwrd"&gt;using&lt;/span&gt; System;
  &lt;span class="kwrd"&gt;using&lt;/span&gt; System.Data;
  &lt;span class="kwrd"&gt;using&lt;/span&gt; System.Web;
  &lt;span class="kwrd"&gt;using&lt;/span&gt; System.Web.UI.WebControls;
  &lt;span class="kwrd"&gt;using&lt;/span&gt; System.Xml;

  &lt;span class="rem"&gt;/// &amp;lt;summary&amp;gt;&lt;/span&gt;
  &lt;span class="rem"&gt;/// &amp;lt;/summary&amp;gt;&lt;/span&gt;
  &lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;partial&lt;/span&gt; &lt;span class="kwrd"&gt;class&lt;/span&gt; ucTree : System.Web.UI.UserControl
  {
    &lt;span class="kwrd"&gt;protected&lt;/span&gt; &lt;span class="kwrd"&gt;void&lt;/span&gt; Page_Load(&lt;span class="kwrd"&gt;object&lt;/span&gt; sender, EventArgs e)
    {
      XmlDataSource1.DataFile = &lt;span class="str"&gt;"~/App_Data/Music.xml"&lt;/span&gt;;
      cdT.Attributes.Add(&lt;span class="str"&gt;"onclick"&lt;/span&gt;, &lt;span class="str"&gt;"OnCheckBoxCheckChanged(event)"&lt;/span&gt;);
    }

    &lt;span class="kwrd"&gt;protected&lt;/span&gt; &lt;span class="kwrd"&gt;void&lt;/span&gt; cdTree_OnPreRender(&lt;span class="kwrd"&gt;object&lt;/span&gt; sender, EventArgs e)
    {
      &lt;span class="kwrd"&gt;if&lt;/span&gt; (!Page.IsPostBack)
      {
        &lt;span class="kwrd"&gt;foreach&lt;/span&gt; (TreeNode node &lt;span class="kwrd"&gt;in&lt;/span&gt; cdT.Nodes) { &lt;span class="kwrd"&gt;this&lt;/span&gt;.CheckNodes(&lt;span class="kwrd"&gt;true&lt;/span&gt;, node); }
      }
    }

    &lt;span class="kwrd"&gt;private&lt;/span&gt; &lt;span class="kwrd"&gt;void&lt;/span&gt; CheckNodes(&lt;span class="kwrd"&gt;bool&lt;/span&gt; check, TreeNode node)
    {
      node.Checked = check;
      &lt;span class="kwrd"&gt;foreach&lt;/span&gt; (TreeNode child &lt;span class="kwrd"&gt;in&lt;/span&gt; node.ChildNodes)
      {
        &lt;span class="kwrd"&gt;if&lt;/span&gt; (child.ChildNodes.Count &amp;gt;= 0) CheckNodes(check, child);
      }
    }
  }
}&lt;/pre&gt;&lt;/p&gt;
&lt;h2&gt;Page (html-markup): pgTree.aspx&lt;/h2&gt;
&lt;p&gt;This is the page that it is launched, it contains the user control: ucTree. Notice in line 2, the user control is registered and then used in line 16 the link to the javascript is on line 9.&lt;/p&gt;
&lt;p&gt;&lt;!-- code formatted by http://manoli.net/csharpformat/ --&gt;
&lt;pre class="csharpcode"&gt;
&lt;span class="asp"&gt;&amp;lt;%@ Page Language="C#" AutoEventWireup="true" CodeFile="pgTree.aspx.cs" Inherits="ns.pgTree" EnableEventValidation="false" %&amp;gt;&lt;/span&gt;
&lt;span class="asp"&gt;&amp;lt;%@ Register TagPrefix="uc1" TagName="ucT" Src="ucTree.ascx" %&amp;gt;&lt;/span&gt;
&lt;span class="kwrd"&gt;&amp;lt;!&lt;/span&gt;&lt;span class="html"&gt;DOCTYPE&lt;/span&gt; &lt;span class="attr"&gt;html&lt;/span&gt; &lt;span class="attr"&gt;PUBLIC&lt;/span&gt; &lt;span class="kwrd"&gt;"-//W3C//DTD XHTML 1.0 Transitional//EN"&lt;/span&gt; &lt;span class="kwrd"&gt;"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;

&lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;html&lt;/span&gt; &lt;span class="attr"&gt;xmlns&lt;/span&gt;&lt;span class="kwrd"&gt;="http://www.w3.org/1999/xhtml"&lt;/span&gt; &lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;

&lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;head&lt;/span&gt; &lt;span class="attr"&gt;id&lt;/span&gt;&lt;span class="kwrd"&gt;="treeHead"&lt;/span&gt; &lt;span class="attr"&gt;runat&lt;/span&gt;&lt;span class="kwrd"&gt;="server"&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;
  &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;title&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;CD TreeView&lt;span class="kwrd"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;title&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;
  &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;script&lt;/span&gt; &lt;span class="attr"&gt;language&lt;/span&gt;&lt;span class="kwrd"&gt;="javascript"&lt;/span&gt; &lt;span class="attr"&gt;src&lt;/span&gt;&lt;span class="kwrd"&gt;="treeBehavior.js"&lt;/span&gt; &lt;span class="attr"&gt;type&lt;/span&gt;&lt;span class="kwrd"&gt;="text/javascript"&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;script&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;  
&lt;span class="kwrd"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;head&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;

&lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;body&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;
&lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;form&lt;/span&gt; &lt;span class="attr"&gt;id&lt;/span&gt;&lt;span class="kwrd"&gt;="submitform"&lt;/span&gt; &lt;span class="attr"&gt;name&lt;/span&gt;&lt;span class="kwrd"&gt;="mainform"&lt;/span&gt; &lt;span class="attr"&gt;method&lt;/span&gt;&lt;span class="kwrd"&gt;="post"&lt;/span&gt; &lt;span class="attr"&gt;runat&lt;/span&gt;&lt;span class="kwrd"&gt;="server"&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;
    &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;div&lt;/span&gt; &lt;span class="attr"&gt;id&lt;/span&gt;&lt;span class="kwrd"&gt;="tabs-1"&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;
    &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;asp:label&lt;/span&gt; &lt;span class="attr"&gt;id&lt;/span&gt;&lt;span class="kwrd"&gt;="Label1"&lt;/span&gt; &lt;span class="attr"&gt;runat&lt;/span&gt;&lt;span class="kwrd"&gt;="server"&lt;/span&gt; &lt;span class="attr"&gt;Text&lt;/span&gt;&lt;span class="kwrd"&gt;="CD's in a TreeView"&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;asp:label&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;    
    &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;uc1:ucT&lt;/span&gt; &lt;span class="attr"&gt;id&lt;/span&gt;&lt;span class="kwrd"&gt;="cdT1"&lt;/span&gt; &lt;span class="attr"&gt;runat&lt;/span&gt;&lt;span class="kwrd"&gt;="server"&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;uc1:ucT&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;
  &lt;span class="kwrd"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;div&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;
&lt;span class="kwrd"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;form&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;
&lt;span class="kwrd"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;body&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;
&lt;span class="kwrd"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;html&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;
&lt;/pre&gt;&lt;/p&gt;

&lt;h2&gt;Page (server-side): pgTree.aspx.cs&lt;/h2&gt;
&lt;p&gt;(no code needed)&lt;/p&gt;

&lt;h2&gt;Partial listing: Music.xml&lt;/h2&gt;
&lt;p&gt;&lt;!-- code formatted by http://manoli.net/csharpformat/ --&gt;
&lt;pre class="csharpcode"&gt;
&lt;span class="kwrd"&gt;&amp;lt;?&lt;/span&gt;&lt;span class="html"&gt;xml&lt;/span&gt; &lt;span class="attr"&gt;version&lt;/span&gt;&lt;span class="kwrd"&gt;="1.0"&lt;/span&gt; &lt;span class="attr"&gt;encoding&lt;/span&gt;&lt;span class="kwrd"&gt;="UTF-8"&lt;/span&gt; ?&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;
&lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;Hierarchy&lt;/span&gt; &lt;span class="attr"&gt;ItemNo&lt;/span&gt;&lt;span class="kwrd"&gt;="0"&lt;/span&gt; &lt;span class="attr"&gt;Title&lt;/span&gt;&lt;span class="kwrd"&gt;="All Rock Music"&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;
  &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;Band&lt;/span&gt; &lt;span class="attr"&gt;ItemNo&lt;/span&gt;&lt;span class="kwrd"&gt;="101.0"&lt;/span&gt; &lt;span class="attr"&gt;Title&lt;/span&gt;&lt;span class="kwrd"&gt;="Aerosmith"&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;
    &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;Album&lt;/span&gt; &lt;span class="attr"&gt;ItemNo&lt;/span&gt;&lt;span class="kwrd"&gt;="101.1"&lt;/span&gt; &lt;span class="attr"&gt;Title&lt;/span&gt;&lt;span class="kwrd"&gt;="Aerosmith"&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;
      &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;Track&lt;/span&gt; &lt;span class="attr"&gt;ItemNo&lt;/span&gt;&lt;span class="kwrd"&gt;="101.101"&lt;/span&gt; &lt;span class="attr"&gt;Title&lt;/span&gt;&lt;span class="kwrd"&gt;="Make It"&lt;/span&gt; &lt;span class="kwrd"&gt;/&amp;gt;&lt;/span&gt;
      &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;Track&lt;/span&gt; &lt;span class="attr"&gt;ItemNo&lt;/span&gt;&lt;span class="kwrd"&gt;="101.102"&lt;/span&gt; &lt;span class="attr"&gt;Title&lt;/span&gt;&lt;span class="kwrd"&gt;="Somebody"&lt;/span&gt; &lt;span class="kwrd"&gt;/&amp;gt;&lt;/span&gt;
      &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;Track&lt;/span&gt; &lt;span class="attr"&gt;ItemNo&lt;/span&gt;&lt;span class="kwrd"&gt;="101.103"&lt;/span&gt; &lt;span class="attr"&gt;Title&lt;/span&gt;&lt;span class="kwrd"&gt;="Dream On"&lt;/span&gt; &lt;span class="kwrd"&gt;/&amp;gt;&lt;/span&gt;
      &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;Track&lt;/span&gt; &lt;span class="attr"&gt;ItemNo&lt;/span&gt;&lt;span class="kwrd"&gt;="101.104"&lt;/span&gt; &lt;span class="attr"&gt;Title&lt;/span&gt;&lt;span class="kwrd"&gt;="One Way Street"&lt;/span&gt; &lt;span class="kwrd"&gt;/&amp;gt;&lt;/span&gt;
      &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;Track&lt;/span&gt; &lt;span class="attr"&gt;ItemNo&lt;/span&gt;&lt;span class="kwrd"&gt;="101.105"&lt;/span&gt; &lt;span class="attr"&gt;Title&lt;/span&gt;&lt;span class="kwrd"&gt;="Mama Kin"&lt;/span&gt; &lt;span class="kwrd"&gt;/&amp;gt;&lt;/span&gt;
      &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;Track&lt;/span&gt; &lt;span class="attr"&gt;ItemNo&lt;/span&gt;&lt;span class="kwrd"&gt;="101.106"&lt;/span&gt; &lt;span class="attr"&gt;Title&lt;/span&gt;&lt;span class="kwrd"&gt;="Write Me A Letter"&lt;/span&gt; &lt;span class="kwrd"&gt;/&amp;gt;&lt;/span&gt;
      &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;Track&lt;/span&gt; &lt;span class="attr"&gt;ItemNo&lt;/span&gt;&lt;span class="kwrd"&gt;="101.107"&lt;/span&gt; &lt;span class="attr"&gt;Title&lt;/span&gt;&lt;span class="kwrd"&gt;="Movin' Out"&lt;/span&gt; &lt;span class="kwrd"&gt;/&amp;gt;&lt;/span&gt;
      &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;Track&lt;/span&gt; &lt;span class="attr"&gt;ItemNo&lt;/span&gt;&lt;span class="kwrd"&gt;="101.108"&lt;/span&gt; &lt;span class="attr"&gt;Title&lt;/span&gt;&lt;span class="kwrd"&gt;="Walkin' The Dog"&lt;/span&gt; &lt;span class="kwrd"&gt;/&amp;gt;&lt;/span&gt;
    &lt;span class="kwrd"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;Album&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;
    &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;Album&lt;/span&gt; &lt;span class="attr"&gt;ItemNo&lt;/span&gt;&lt;span class="kwrd"&gt;="101.2"&lt;/span&gt; &lt;span class="attr"&gt;Title&lt;/span&gt;&lt;span class="kwrd"&gt;="Done With Mirrors"&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;
      &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;Track&lt;/span&gt; &lt;span class="attr"&gt;ItemNo&lt;/span&gt;&lt;span class="kwrd"&gt;="101.201"&lt;/span&gt; &lt;span class="attr"&gt;Title&lt;/span&gt;&lt;span class="kwrd"&gt;="Let The Music Do The Talking"&lt;/span&gt; &lt;span class="kwrd"&gt;/&amp;gt;&lt;/span&gt;
      &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;Track&lt;/span&gt; &lt;span class="attr"&gt;ItemNo&lt;/span&gt;&lt;span class="kwrd"&gt;="101.202"&lt;/span&gt; &lt;span class="attr"&gt;Title&lt;/span&gt;&lt;span class="kwrd"&gt;="My Fist Your Face"&lt;/span&gt; &lt;span class="kwrd"&gt;/&amp;gt;&lt;/span&gt;
      &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;Track&lt;/span&gt; &lt;span class="attr"&gt;ItemNo&lt;/span&gt;&lt;span class="kwrd"&gt;="101.203"&lt;/span&gt; &lt;span class="attr"&gt;Title&lt;/span&gt;&lt;span class="kwrd"&gt;="Shame On You"&lt;/span&gt; &lt;span class="kwrd"&gt;/&amp;gt;&lt;/span&gt;&lt;br/&gt;etc...
&lt;/pre&gt;&lt;/p&gt;
&lt;p&gt;This is a simple example using a treeview with checkboxes which functions to show whether the entire branch is selected or not with a single-click (it would have been ideal if the treeview had 3 states: checked, denoting some  partially checked and unchecked, but it doesn't). This example also shows an approach to break a project apart into subsections, in this project: user controls. Now, if there was a need to use this treeview on multiple pages, you only need to add 3 lines of code to the new page and your done.&lt;/p&gt;

&lt;p&gt;In a later post, we will show how to save the users selection and retrieve it...&lt;/p&gt;
&lt;p&gt;Download Project:&amp;nbsp;&lt;a href="http://www.thewebpepper.net/file.axd?file=2010%2f3%2fTreeview.zip"&gt;Treeview.zip (6.31 kb)&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;!-- And... comments are always welcome, the good and the bad. --&gt;&lt;strong&gt;&lt;em&gt;the WebPepper team&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/theWebNeck/~4/8-RXJK7ZjxE" height="1" width="1"/&gt;</description>
      <link>http://feedproxy.google.com/~r/theWebNeck/~3/8-RXJK7ZjxE/post.aspx</link>
      <author>the WebNeck</author>
      <comments>http://www.thewebpepper.net/post/2010/03/06/TreeView-(Part-1-Multiple-Select).aspx#comment</comments>
      <guid isPermaLink="false">http://www.thewebpepper.net/post.aspx?id=3da9f223-45be-4b11-a6e0-93f899b1edaa</guid>
      <pubDate>Sat, 06 Mar 2010 07:07:00 +0500</pubDate>
      <category>ASP .Net</category>
      <category>C#</category>
      <dc:publisher>the WebNeck</dc:publisher>
      <pingback:server>http://www.thewebpepper.net/pingback.axd</pingback:server>
      <pingback:target>http://www.thewebpepper.net/post.aspx?id=3da9f223-45be-4b11-a6e0-93f899b1edaa</pingback:target>
      <slash:comments>0</slash:comments>
      <trackback:ping>http://www.thewebpepper.net/trackback.axd?id=3da9f223-45be-4b11-a6e0-93f899b1edaa</trackback:ping>
      <wfw:comment>http://www.thewebpepper.net/post/2010/03/06/TreeView-(Part-1-Multiple-Select).aspx#comment</wfw:comment>
      <wfw:commentRss>http://www.thewebpepper.net/syndication.axd?post=3da9f223-45be-4b11-a6e0-93f899b1edaa</wfw:commentRss>
    <feedburner:origLink>http://www.thewebpepper.net/post.aspx?id=3da9f223-45be-4b11-a6e0-93f899b1edaa</feedburner:origLink></item>
    <item>
      <title>It's About Time: Double Explorer (free)</title>
      <description>&lt;p&gt;Download: &lt;a rel="nofollow" href="http://wde.codeplex.com" target="_blank"&gt;Double Explorer at CodePlex&lt;/a&gt;&lt;/p&gt;
&lt;h2&gt;Double Explorer: Something Worthwhile and Free&lt;/h2&gt;
&lt;p&gt;How many times have you had to rummage through the task-bar to find the correct Windows Explorer window so you can copy/move files from one location to another, what a royal pain. In talking with a colleague I mentioned that with all the advancements made in the Windows OS, the Explorer has seen relatively few and still somewhat archaic. I mentioned that it would be nice if it had something with multiple panes and tab-strips. He said "... that &lt;span style="text-decoration: underline;"&gt;would&lt;/span&gt; be great."&lt;/p&gt;
&lt;h2&gt;Well It's Real-Ware...&lt;/h2&gt;
&lt;p&gt;A day later, in reading some news feeds, I couldn't believe it, something about just that: Double Explorer. It's free (donations are welcomed), works on Windows 7 (32 &amp;amp; 64-bit) and Vista 32-bit (some users had some problems in Vista 64-bit and who hasn't had problems with Vista, but it did work in Vista 64-bit for me).&lt;/p&gt;
&lt;p&gt;I am not one to write reviews (and if this is considered a review, I consider it a poor attempt), but just wanted to share something which I found to be handy and easy to use.&lt;/p&gt;
&lt;p align="center"&gt;&lt;img src="http://www.thewebpepper.com/articleimages/DblExplorer.png" alt="Double Explorer Screen Dump" width="520" height="511" /&gt;&lt;br /&gt;Available at CodePlex&lt;/p&gt;
&lt;p&gt;&lt;!-- And... comments are always welcome, the good and the bad. --&gt;&lt;strong&gt;&lt;em&gt;the WebPepper team&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/theWebNeck/~4/n9ow8DLiJ50" height="1" width="1"/&gt;</description>
      <link>http://feedproxy.google.com/~r/theWebNeck/~3/n9ow8DLiJ50/post.aspx</link>
      <author>the WebNeck</author>
      <comments>http://www.thewebpepper.net/post/2010/02/27/Tool-Utility-Double-Explorer-(free).aspx#comment</comments>
      <guid isPermaLink="false">http://www.thewebpepper.net/post.aspx?id=851715d6-fe40-43ec-a3fc-dd7488925ea0</guid>
      <pubDate>Sat, 27 Feb 2010 20:46:00 +0500</pubDate>
      <category>Commentary</category>
      <dc:publisher>the WebNeck</dc:publisher>
      <pingback:server>http://www.thewebpepper.net/pingback.axd</pingback:server>
      <pingback:target>http://www.thewebpepper.net/post.aspx?id=851715d6-fe40-43ec-a3fc-dd7488925ea0</pingback:target>
      <slash:comments>0</slash:comments>
      <trackback:ping>http://www.thewebpepper.net/trackback.axd?id=851715d6-fe40-43ec-a3fc-dd7488925ea0</trackback:ping>
      <wfw:comment>http://www.thewebpepper.net/post/2010/02/27/Tool-Utility-Double-Explorer-(free).aspx#comment</wfw:comment>
      <wfw:commentRss>http://www.thewebpepper.net/syndication.axd?post=851715d6-fe40-43ec-a3fc-dd7488925ea0</wfw:commentRss>
    <feedburner:origLink>http://www.thewebpepper.net/post.aspx?id=851715d6-fe40-43ec-a3fc-dd7488925ea0</feedburner:origLink></item>
    <item>
      <title>Advertising on the WebNeck</title>
      <description>&lt;h2&gt;Will the WebPepper ever allow advertising on the WebNeck's site?&lt;/h2&gt;
&lt;p&gt;The answer is simple: "&lt;strong&gt;No!&lt;/strong&gt;" and we mean no as in never!&lt;/p&gt;
&lt;p&gt;Any advertising on a site such as this would be a distraction, you ended up here because you were after a solution to a question, not to be redirected to some sales pitch.&lt;/p&gt;
&lt;h2&gt;Why?&lt;/h2&gt;
&lt;p&gt;This site is intended to be for the use of developers and those who want to get there feet wet in developing for the web. There is nothing on this site that is: for sale, on sale, discounted or on close-out. It is not to promote anything which might end up with a price-tag, unless the price-tag is knowledge.&lt;/p&gt;
&lt;p&gt;The only price allowed is the value you place on your time to visit, this is the only price you pay, your time that you set aside to read an article, and nothing else. We appreciate you devoting your time to do this and hope you found it worthwhile.&lt;/p&gt;
&lt;p&gt;We appreciate and welcome your comments, again the expense is only the value of your time to do so.&lt;/p&gt;
&lt;h2&gt;What does the WebPepper expect to get in return?&lt;/h2&gt;
&lt;p&gt;Monetarily - none; the return is improved efficiency, less bugs and an increased satisfaction of a job done well. It is a resource for you as well as for us.&lt;/p&gt;
&lt;h2&gt;Then, why even share techniques that are used by the WebPepper with others?&lt;/h2&gt;
&lt;p&gt;&lt;em&gt;Usually, such things are kept private and protected.&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;One purpose is to raise the bar, employ better solutions and above all, a way to do so.&lt;/p&gt;
&lt;p&gt;There will always be another way of doing something and maybe there is an alternative which is better, we are open to these suggestions and we are a good listener.&lt;/p&gt;
&lt;p&gt;The developer is faced with many tasks, all of which are important, but vary in scope from being absolutely vague to absolutely specific. The items which are specific, are generally those which are forgotten or lost in a sea of mud. Those are the butt-busters for meeting project deadlines. We hope to be a service in those situations.&lt;/p&gt;
&lt;h2&gt;Don't you find spam as a problem?&lt;/h2&gt;
&lt;p&gt;&lt;em&gt;Does a skunk stink?&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;Spam, is a direct approach to sell indirectly. And yes, it is just one of many aspects of the web that stink. Maybe, together, we'll discover a solution to the stench... (currently the bucket is flushed, daily).&lt;/p&gt;
&lt;h2&gt;In Closing&lt;/h2&gt;
&lt;p&gt;We want to let you know, we are here, we are listening and encourage you to share your thoughts, ideas and techniques, as we attempt to do, to make the task of web programming simpler and of value.&lt;/p&gt;
&lt;p&gt;&amp;nbsp;&lt;/p&gt;
&lt;p&gt;Thank you, for your time.&lt;/p&gt;
&lt;p&gt;&lt;!-- And... comments are always welcome, the good and the bad. --&gt;&lt;strong&gt;&lt;em&gt;the WebPepper team&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/theWebNeck/~4/Qy3e9p6LqwM" height="1" width="1"/&gt;</description>
      <link>http://feedproxy.google.com/~r/theWebNeck/~3/Qy3e9p6LqwM/post.aspx</link>
      <author>the WebNeck</author>
      <comments>http://www.thewebpepper.net/post/2010/02/01/Advertising-on-the-WebNeck.aspx#comment</comments>
      <guid isPermaLink="false">http://www.thewebpepper.net/post.aspx?id=6019e45b-4c68-468d-85d9-dad1d24bcf20</guid>
      <pubDate>Mon, 01 Feb 2010 03:00:00 +0500</pubDate>
      <category>Commentary</category>
      <category>General</category>
      <dc:publisher>the WebNeck</dc:publisher>
      <pingback:server>http://www.thewebpepper.net/pingback.axd</pingback:server>
      <pingback:target>http://www.thewebpepper.net/post.aspx?id=6019e45b-4c68-468d-85d9-dad1d24bcf20</pingback:target>
      <slash:comments>0</slash:comments>
      <trackback:ping>http://www.thewebpepper.net/trackback.axd?id=6019e45b-4c68-468d-85d9-dad1d24bcf20</trackback:ping>
      <wfw:comment>http://www.thewebpepper.net/post/2010/02/01/Advertising-on-the-WebNeck.aspx#comment</wfw:comment>
      <wfw:commentRss>http://www.thewebpepper.net/syndication.axd?post=6019e45b-4c68-468d-85d9-dad1d24bcf20</wfw:commentRss>
    <feedburner:origLink>http://www.thewebpepper.net/post.aspx?id=6019e45b-4c68-468d-85d9-dad1d24bcf20</feedburner:origLink></item>
    <item>
      <title>Dynamic Themes with Nested Master Pages</title>
      <description>&lt;p&gt;&lt;a href="http://www.thewebpepper.net/file.axd?file=2010%2f1%2fWebPageMaster_2009-01-31.zip"&gt;WebPageMaster Project w/Themes and Accordion Menu Download  (1.00 mb)&lt;/a&gt;&lt;br /&gt; &lt;a href="http://www.thewebpepper.net/file.axd?file=2010%2f1%2fWebNeck_2009-01-31_a_Silver.gif"&gt;Screen Shot Silver (35.41 kb)&lt;/a&gt;&lt;br /&gt; &lt;a href="http://www.thewebpepper.net/file.axd?file=2010%2f1%2fWebNeck_2009-01-31_b_Gold.gif"&gt;Screen Shot Gold (35.49 kb)&lt;/a&gt;&lt;/p&gt;
&lt;h2&gt;Master Pages (3&lt;sup&gt;rd&lt;/sup&gt; of a Series)&lt;/h2&gt;
&lt;p&gt;You're probably getting bored looking at the same site over and over, now you need to set up the site for the visually-impaired, or need to change the look for an upcoming holiday. Whatever, using themes will fit the bill. As developers we find it refreshing...&lt;/p&gt;
&lt;p&gt;Now, let's add a twist to applying a theme, instead of setting the pages tag in the web.config, let's make it dynamic so the user change can it on the opening screen. If the user were to log into the site, you could then save it as a preference, but let's just concentrate on applying a theme dynamically.&lt;/p&gt;
&lt;p&gt;Here, we will try to make it simple (and it is).&lt;/p&gt;
&lt;h2&gt;the Building Blocks: the 'New Stuff' in the App_Code and the App_Themes folders&lt;/h2&gt;
&lt;p&gt;&lt;strong&gt;App_Code folder&lt;/strong&gt;: just copy these three files to your project within the App_Code folder. (They are part of the download or you can get them &lt;a style="color:black; text-decoration:underline;" href="http://www.edream.org/BlogArticle.aspx?RecordID=103" target="_blank"&gt;here&lt;/a&gt;).&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;BasePage.cs&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Theme.cs&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;ThemeManager.cs&lt;/strong&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;div class="tip"&gt;&lt;strong&gt;Tip:&lt;/strong&gt;&amp;nbsp;&amp;nbsp;To find out more on Dynamic Themes, check out Sue's edream Blog for a tutorial: &lt;a style="color:black; text-decoration:underline;" rel="nofollow" href="http://www.edream.org/BlogArticle.aspx?RecordID=103" target="_blank"&gt;Extending Personal Web Site (6): Dynamic themes (1 of 2)&lt;/a&gt;. &lt;b&gt;&lt;i&gt;Sorry, it appears she is have some problems with her site.&lt;/i&gt;&lt;/b&gt;&lt;/div&gt;
&lt;p&gt;Basically, they are to build upon the System.Web.UI.Page and set the theme using a Session Variable. Instead of inheriting 'System.Web.UI.Page' on the server-side code you will be using 'BasePage'. And within the [BasePage.cs] is where you now set the default theme, in this project it is set to 'Standard'.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;App_Themes folder&lt;/strong&gt;: First, we added the folder [App_Themes] and a subfolder: [Standard] which will be our default theme, within this folder we moved ..\MasterStuff\Style.css and the ..\MasterStuff\images folder to the Standard folder, we then renamed [Styles.css] to 'Default.css'. Also, we added to our Default.css, a class .U_Theme which you find under the comment /* Radio control for Themes */ to handle the style of the radio button to change themes.&lt;/p&gt;
&lt;p&gt;Second, we copied our [Standard] folder and renamed it 'Gold', Where we changed the images in the [Images] folder to be gold in color (keeping the same name to the images, being lazy so we limit the edits to the css...).&lt;/p&gt;
&lt;p&gt;Now within our project environment, things look like this:&lt;/p&gt;
&lt;p align="center"&gt;&lt;img title="Visual Studio Screen Dump" src="http://www.thewebpepper.com/ForDownload/WebNeck_2009-01-31.gif" alt="Visual Studio Screen Dump" /&gt;&lt;/p&gt;
&lt;p&gt;Sha-Zaam, were almost done... Change the server-side code of all your pages which you want to implement the chosen theme (we chose all of them) from: &lt;!-- code formatted by http://manoli.net/csharpformat/ --&gt;&lt;/p&gt;
&lt;pre class="csharpcode"&gt;&lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;partial&lt;/span&gt; &lt;span class="kwrd"&gt;class&lt;/span&gt; &lt;span class="str"&gt;"bla_bla_bla"&lt;/span&gt; : System.Web.UI.Page
{...

&lt;span class="rem"&gt;//to&lt;/span&gt;
&lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;partial&lt;/span&gt; &lt;span class="kwrd"&gt;class&lt;/span&gt; &lt;span class="str"&gt;"bla_bla_bla"&lt;/span&gt; : BasePage
{...&lt;/pre&gt;
&lt;p&gt;And then add the radio control to the [Default.aspx] page.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Note:&lt;/strong&gt;&amp;nbsp;&amp;nbsp;If you wanted to move the radio button for the theme setting to the footer of this sample project (so, it will always be visible within this project), which is in /masterstuff/Site.master (which is not in the root, where as default.aspx is), you will have to make a change in /App_Code/ThemeManager.cs as shown below (add "~/" in the MapPath statement):&lt;/p&gt;
&lt;div class="tip"&gt;
&lt;pre class="csharpcode"&gt;&lt;span class="rem"&gt;//from&lt;/span&gt;
DirectoryInfo dInfo = &lt;span class="kwrd"&gt;new&lt;/span&gt; DirectoryInfo(System.Web.HttpContext.Current.Server.MapPath(&lt;span class="str"&gt;"App_Themes"&lt;/span&gt;));

&lt;span class="rem"&gt;//to&lt;/span&gt;
DirectoryInfo dInfo = &lt;span class="kwrd"&gt;new&lt;/span&gt; DirectoryInfo(System.Web.HttpContext.Current.Server.MapPath(&lt;span class="str"&gt;"~/App_Themes"&lt;/span&gt;));&lt;/pre&gt;
&lt;/div&gt;
&lt;p&gt;&lt;span style="font-size: 15px; font-weight: bold;"&gt;the Result&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;When entering the site, we are presented with this:&lt;/p&gt;
&lt;p align="center"&gt;&lt;img title="[Standard Theme] Screen Dump" src="http://www.thewebpepper.com/ForDownload/WebNeck_2009-01-31_a.gif" alt="MasterPage Demo Screen Shot" /&gt;&lt;/p&gt;
&lt;p&gt;Click on the radio button control to gold, we are now presented with this:&lt;/p&gt;
&lt;p align="center"&gt;&lt;img title="[Gold Theme] Screen Dump" src="http://www.thewebpepper.com/ForDownload/WebNeck_2009-01-31_b.gif" alt="MasterPage Demo Screen Shot" /&gt;&lt;/p&gt;
&lt;p&gt;And then the chosen theme is used throughout the entire site:&lt;/p&gt;
&lt;p align="center"&gt;&lt;img title="[Gold Theme] Screen Dump" src="http://www.thewebpepper.com/ForDownload/WebNeck_2009-01-31_c.gif" alt="MasterPage Demo Screen Shot" /&gt;&lt;/p&gt;
&lt;p&gt;As you add more themes (folders under the App_Themes), they will automatically update the radio control, which is cool... theme on!&lt;/p&gt;
&lt;div class="tip"&gt;&lt;strong&gt;Tip&lt;/strong&gt;: It is recommended that your standard/default theme address all the capabilities of your site, this is one reason that the site was first built without themes, by providing additional themes you are able to limit the functionality of the site. So, it would be advantageous to have a default/standard, and this tip may be in another topic to post which addresses this issue.&lt;/div&gt;
&lt;p&gt;&lt;a href="http://www.thewebpepper.net/file.axd?file=2010%2f1%2fWebNeck_2009-01-31_a_Silver.gif"&gt;Screen Shot Silver (35.41 kb)&lt;/a&gt;&lt;br /&gt; &lt;a href="http://www.thewebpepper.net/file.axd?file=2010%2f1%2fWebNeck_2009-01-31_b_Gold.gif"&gt;Screen Shot Gold (35.49 kb)&lt;/a&gt;&lt;br /&gt; &lt;a href="http://www.thewebpepper.net/file.axd?file=2010%2f1%2fWebPageMaster_2009-01-31.zip"&gt;WebPageMaster Project w/Themes and Accordion Menu Download  (1.00 mb)&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;!-- And... comments are always welcome, the good and the bad. --&gt;&lt;strong&gt;&lt;em&gt;the WebPepper team&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/theWebNeck/~4/On6GqcxbuGI" height="1" width="1"/&gt;</description>
      <link>http://feedproxy.google.com/~r/theWebNeck/~3/On6GqcxbuGI/post.aspx</link>
      <author>the WebNeck</author>
      <comments>http://www.thewebpepper.net/post/2010/02/01/Theming-a-Nested-Master-Page-Site.aspx#comment</comments>
      <guid isPermaLink="false">http://www.thewebpepper.net/post.aspx?id=fe928130-531a-43e5-9ad7-401eb77467cf</guid>
      <pubDate>Mon, 01 Feb 2010 02:20:00 +0500</pubDate>
      <category>ASP .Net</category>
      <category>C#</category>
      <category>MasterPages</category>
      <dc:publisher>the WebNeck</dc:publisher>
      <pingback:server>http://www.thewebpepper.net/pingback.axd</pingback:server>
      <pingback:target>http://www.thewebpepper.net/post.aspx?id=fe928130-531a-43e5-9ad7-401eb77467cf</pingback:target>
      <slash:comments>0</slash:comments>
      <trackback:ping>http://www.thewebpepper.net/trackback.axd?id=fe928130-531a-43e5-9ad7-401eb77467cf</trackback:ping>
      <wfw:comment>http://www.thewebpepper.net/post/2010/02/01/Theming-a-Nested-Master-Page-Site.aspx#comment</wfw:comment>
      <wfw:commentRss>http://www.thewebpepper.net/syndication.axd?post=fe928130-531a-43e5-9ad7-401eb77467cf</wfw:commentRss>
    <feedburner:origLink>http://www.thewebpepper.net/post.aspx?id=fe928130-531a-43e5-9ad7-401eb77467cf</feedburner:origLink></item>
    <item>
      <title>Accordion Menu within a Nested Master Page</title>
      <description>&lt;p&gt;&lt;a href="http://www.thewebpepper.net/file.axd?file=2010%2f1%2fWebPageMaster_2009-01-30.zip"&gt;WebPageMaster Project w/Accordian Menu Download (959.90 kb)&lt;/a&gt;&lt;br /&gt;&lt;a href="http://www.thewebpepper.net/file.axd?file=2010%2f1%2fWebNeck_2009-01-30.gif"&gt;Screen Shot (29.41 kb)&lt;/a&gt;&lt;/p&gt;
&lt;h2&gt;Master Pages (2&lt;sup&gt;nd&lt;/sup&gt; of a Series)&lt;/h2&gt;
&lt;p&gt;Just when you thought is was plug-in-play from here on in and adding a control is now starting to be a flippin', nested hassle... and you're ready to say 'screw this', hold on...&lt;/p&gt;
&lt;p&gt;So, you downloaded the Ajax Control Toolkit to be part of your Visual Studio environment and found that the Accordion Control is a cool one and it should be used in the side menu (in the MasterPage demo project of the previous article). So you gave it a whirl, and the damn thing ain't working as expected. Again, this is due to how MasterPages are assembled and work. Now, let's put the frustration aside and read on...&lt;/p&gt;
&lt;h2&gt;the Definition: The way we want it to work&lt;/h2&gt;
&lt;p&gt;Let's say to start with, is that when you open a link from a pane which is not a default pane of the accordion control, you want it to remain open (which it won't, yet). Second, if you go to another main menu option and return to this one, you would like to see the pane which was last opened, which launched a link in that pane.&lt;/p&gt;
&lt;p&gt;Here, we will try to make it simple (and it is).&lt;/p&gt;
&lt;p align="center"&gt;&lt;img title="Screen Dump" src="http://www.thewebpepper.com/ForDownload/WebNeck_2009-01-30.gif" alt="MasterPage Demo Screen Shot" /&gt;&lt;/p&gt;
&lt;p&gt;When the user launches Sales Orders or Sales Invoices, the Receivables pane will now be the default open pane for the session. This default will change as the user launches other menu items from other panes.&lt;/p&gt;
&lt;p&gt;Just a note, code was added to the style sheet /MasterStuff/Styles.css for the visual effects and this was appended under the comment /* Accordion Control */ in the new project download above.&lt;/p&gt;
&lt;h2&gt;the Accordion Control: from the Ajax Control Tookit&lt;/h2&gt;
&lt;p&gt;This is the Accordion control that was added to the file: [AcctMenu.Master], don't forget to register the assembly for the AjaxControlToolkit on the top of the page...&lt;/p&gt;
&lt;!-- code formatted by http://manoli.net/csharpformat/ --&gt;
&lt;pre class="csharpcode"&gt;&lt;span class="asp"&gt;&amp;lt;%@ Master Language="C#" MasterPageFile="~/MasterStuff/Site.master" CodeFile="~/MasterStuff/AcctgMenu.master.cs" Inherits="AcctgMenu"%&amp;gt;&lt;/span&gt; 
&lt;span class="asp"&gt;&amp;lt;%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="ajx" %&amp;gt;&lt;/span&gt;

&lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;asp:Content&lt;/span&gt; &lt;span class="attr"&gt;id&lt;/span&gt;&lt;span class="kwrd"&gt;="Content1"&lt;/span&gt; &lt;span class="attr"&gt;ContentPlaceholderID&lt;/span&gt;&lt;span class="kwrd"&gt;="ChildContent"&lt;/span&gt; &lt;span class="attr"&gt;runat&lt;/span&gt;&lt;span class="kwrd"&gt;="server"&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;
  &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;div&lt;/span&gt; &lt;span class="attr"&gt;id&lt;/span&gt;&lt;span class="kwrd"&gt;="R_mainWrapper"&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;asp:ContentPlaceHolder&lt;/span&gt; &lt;span class="attr"&gt;id&lt;/span&gt;&lt;span class="kwrd"&gt;="MainContent"&lt;/span&gt; &lt;span class="attr"&gt;runat&lt;/span&gt;&lt;span class="kwrd"&gt;="server"&lt;/span&gt; &lt;span class="kwrd"&gt;/&amp;gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;div&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;
    
  &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;div&lt;/span&gt; &lt;span class="attr"&gt;id&lt;/span&gt;&lt;span class="kwrd"&gt;="leftContent"&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;
    &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;p&lt;/span&gt; &lt;span class="attr"&gt;style&lt;/span&gt;&lt;span class="kwrd"&gt;="text-align: center;"&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;
      &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;asp:Label&lt;/span&gt; &lt;span class="attr"&gt;ID&lt;/span&gt;&lt;span class="kwrd"&gt;="DateDisplay"&lt;/span&gt; &lt;span class="attr"&gt;runat&lt;/span&gt;&lt;span class="kwrd"&gt;="server"&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;asp:Label&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;
    &lt;span class="kwrd"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;p&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;
    
    &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;h3&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;Accounting Menu&lt;span class="kwrd"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;h3&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;       

  &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;asp:ScriptManager&lt;/span&gt; &lt;span class="attr"&gt;ID&lt;/span&gt;&lt;span class="kwrd"&gt;="ScriptManager1"&lt;/span&gt; &lt;span class="attr"&gt;runat&lt;/span&gt;&lt;span class="kwrd"&gt;="server"&lt;/span&gt; &lt;span class="kwrd"&gt;/&amp;gt;&lt;/span&gt;
  &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;ajx:Accordion&lt;/span&gt; &lt;span class="attr"&gt;ID&lt;/span&gt;&lt;span class="kwrd"&gt;="AccountingMenu"&lt;/span&gt; &lt;span class="attr"&gt;runat&lt;/span&gt;&lt;span class="kwrd"&gt;="server"&lt;/span&gt; &lt;span class="attr"&gt;TransitionDuration&lt;/span&gt;&lt;span class="kwrd"&gt;="250"&lt;/span&gt; &lt;span class="attr"&gt;FramesPerSecond&lt;/span&gt;&lt;span class="kwrd"&gt;="40"&lt;/span&gt;
    &lt;span class="attr"&gt;FadeTransitions&lt;/span&gt;&lt;span class="kwrd"&gt;="true"&lt;/span&gt; 
    &lt;span class="attr"&gt;HeaderCssClass&lt;/span&gt;&lt;span class="kwrd"&gt;="acc-header"&lt;/span&gt; &lt;span class="attr"&gt;ContentCssClass&lt;/span&gt;&lt;span class="kwrd"&gt;="acc-content"&lt;/span&gt; &lt;span class="attr"&gt;HeaderSelectedCssClass&lt;/span&gt;&lt;span class="kwrd"&gt;="acc-selected"&lt;/span&gt;
    &lt;span class="attr"&gt;SuppressHeaderPostbacks&lt;/span&gt;&lt;span class="kwrd"&gt;="true"&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;
   &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;Panes&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;
      &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;ajx:AccordionPane&lt;/span&gt; &lt;span class="attr"&gt;ID&lt;/span&gt;&lt;span class="kwrd"&gt;="AccordionPane1"&lt;/span&gt; &lt;span class="attr"&gt;runat&lt;/span&gt;&lt;span class="kwrd"&gt;="server"&lt;/span&gt; &lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;
        &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;Header&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;&lt;span class="attr"&gt;&amp;amp;nbsp;&lt;/span&gt;Main&lt;span class="kwrd"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;Header&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;
          &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;Content&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;  
            &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;ul&lt;/span&gt; &lt;span class="attr"&gt;class&lt;/span&gt;&lt;span class="kwrd"&gt;="SideUl"&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;
              &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;li&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;
                &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;asp:LinkButton&lt;/span&gt; &lt;span class="attr"&gt;ID&lt;/span&gt;&lt;span class="kwrd"&gt;="lnkb1"&lt;/span&gt; &lt;span class="attr"&gt;runat&lt;/span&gt;&lt;span class="kwrd"&gt;="server"&lt;/span&gt; &lt;span class="attr"&gt;OnClick&lt;/span&gt;&lt;span class="kwrd"&gt;="MenuLinkButton_OnClick"&lt;/span&gt; 
                &lt;span class="attr"&gt;CommandArgument&lt;/span&gt;&lt;span class="kwrd"&gt;="AcctgHome.aspx"&lt;/span&gt; &lt;span class="attr"&gt;Text&lt;/span&gt;&lt;span class="kwrd"&gt;="Accounting Home"&lt;/span&gt; &lt;span class="kwrd"&gt;/&amp;gt;&lt;/span&gt;
              &lt;span class="kwrd"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;li&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;  
              &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;li&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;
                &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;asp:LinkButton&lt;/span&gt; &lt;span class="attr"&gt;ID&lt;/span&gt;&lt;span class="kwrd"&gt;="lnkb2"&lt;/span&gt; &lt;span class="attr"&gt;runat&lt;/span&gt;&lt;span class="kwrd"&gt;="server"&lt;/span&gt; &lt;span class="attr"&gt;OnClick&lt;/span&gt;&lt;span class="kwrd"&gt;="MenuLinkButton_OnClick"&lt;/span&gt; 
                &lt;span class="attr"&gt;CommandArgument&lt;/span&gt;&lt;span class="kwrd"&gt;="AcctgAbout.aspx"&lt;/span&gt; &lt;span class="attr"&gt;Text&lt;/span&gt;&lt;span class="kwrd"&gt;="About Accounting"&lt;/span&gt; &lt;span class="kwrd"&gt;/&amp;gt;&lt;/span&gt;
              &lt;span class="kwrd"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;li&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;  
            &lt;span class="kwrd"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;ul&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;
        &lt;span class="kwrd"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;Content&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;
      &lt;span class="kwrd"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;ajx:AccordionPane&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;
              
      &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;ajx:AccordionPane&lt;/span&gt; &lt;span class="attr"&gt;ID&lt;/span&gt;&lt;span class="kwrd"&gt;="AccordionPane2"&lt;/span&gt; &lt;span class="attr"&gt;runat&lt;/span&gt;&lt;span class="kwrd"&gt;="server"&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;
        &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;Header&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;&lt;span class="attr"&gt;&amp;amp;nbsp;&lt;/span&gt;Receivables&lt;span class="kwrd"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;Header&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;
          &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;Content&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;  
            &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;ul&lt;/span&gt; &lt;span class="attr"&gt;class&lt;/span&gt;&lt;span class="kwrd"&gt;="SideUl"&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;
              &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;li&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;
                &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;asp:LinkButton&lt;/span&gt; &lt;span class="attr"&gt;ID&lt;/span&gt;&lt;span class="kwrd"&gt;="lnkb3"&lt;/span&gt; &lt;span class="attr"&gt;runat&lt;/span&gt;&lt;span class="kwrd"&gt;="server"&lt;/span&gt; &lt;span class="attr"&gt;OnClick&lt;/span&gt;&lt;span class="kwrd"&gt;="MenuLinkButton_OnClick"&lt;/span&gt; 
                &lt;span class="attr"&gt;CommandArgument&lt;/span&gt;&lt;span class="kwrd"&gt;="SO.aspx"&lt;/span&gt; &lt;span class="attr"&gt;Text&lt;/span&gt;&lt;span class="kwrd"&gt;="Sales Order"&lt;/span&gt; &lt;span class="kwrd"&gt;/&amp;gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;li&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;  
              &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;li&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;
                &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;asp:LinkButton&lt;/span&gt; &lt;span class="attr"&gt;ID&lt;/span&gt;&lt;span class="kwrd"&gt;="lnkb4"&lt;/span&gt; &lt;span class="attr"&gt;runat&lt;/span&gt;&lt;span class="kwrd"&gt;="server"&lt;/span&gt; &lt;span class="attr"&gt;OnClick&lt;/span&gt;&lt;span class="kwrd"&gt;="MenuLinkButton_OnClick"&lt;/span&gt;
                &lt;span class="attr"&gt;CommandArgument&lt;/span&gt;&lt;span class="kwrd"&gt;="SI.aspx"&lt;/span&gt; &lt;span class="attr"&gt;Text&lt;/span&gt;&lt;span class="kwrd"&gt;="Sales Invoice"&lt;/span&gt; &lt;span class="kwrd"&gt;/&amp;gt;&lt;/span&gt;
              &lt;span class="kwrd"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;li&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;  
            &lt;span class="kwrd"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;ul&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;
        &lt;span class="kwrd"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;Content&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;
      &lt;span class="kwrd"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;ajx:AccordionPane&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;
              
       &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;ajx:AccordionPane&lt;/span&gt; &lt;span class="attr"&gt;ID&lt;/span&gt;&lt;span class="kwrd"&gt;="AccordionPane3"&lt;/span&gt; &lt;span class="attr"&gt;runat&lt;/span&gt;&lt;span class="kwrd"&gt;="server"&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;
        &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;Header&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;&lt;span class="attr"&gt;&amp;amp;nbsp;&lt;/span&gt;Payables&lt;span class="kwrd"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;Header&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;
          &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;Content&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;  
            &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;ul&lt;/span&gt; &lt;span class="attr"&gt;class&lt;/span&gt;&lt;span class="kwrd"&gt;="SideUl"&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;
              &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;li&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;
                &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;asp:LinkButton&lt;/span&gt; &lt;span class="attr"&gt;ID&lt;/span&gt;&lt;span class="kwrd"&gt;="lnkb5"&lt;/span&gt; &lt;span class="attr"&gt;runat&lt;/span&gt;&lt;span class="kwrd"&gt;="server"&lt;/span&gt; &lt;span class="attr"&gt;OnClick&lt;/span&gt;&lt;span class="kwrd"&gt;="MenuLinkButton_OnClick"&lt;/span&gt; 
                &lt;span class="attr"&gt;CommandArgument&lt;/span&gt;&lt;span class="kwrd"&gt;="PO.aspx"&lt;/span&gt; &lt;span class="attr"&gt;Text&lt;/span&gt;&lt;span class="kwrd"&gt;="Purchase Order"&lt;/span&gt; &lt;span class="kwrd"&gt;/&amp;gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;li&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;  
              &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;li&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;
                &lt;span class="kwrd"&gt;&amp;lt;&lt;/span&gt;&lt;span class="html"&gt;asp:LinkButton&lt;/span&gt; &lt;span class="attr"&gt;ID&lt;/span&gt;&lt;span class="kwrd"&gt;="lnkb6"&lt;/span&gt; &lt;span class="attr"&gt;runat&lt;/span&gt;&lt;span class="kwrd"&gt;="server"&lt;/span&gt; &lt;span class="attr"&gt;OnClick&lt;/span&gt;&lt;span class="kwrd"&gt;="MenuLinkButton_OnClick"&lt;/span&gt;
                &lt;span class="attr"&gt;CommandArgument&lt;/span&gt;&lt;span class="kwrd"&gt;="PI.aspx"&lt;/span&gt; &lt;span class="attr"&gt;Text&lt;/span&gt;&lt;span class="kwrd"&gt;="Purchase Invoice"&lt;/span&gt; &lt;span class="kwrd"&gt;/&amp;gt;&lt;/span&gt;
              &lt;span class="kwrd"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;li&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;  
            &lt;span class="kwrd"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;ul&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;
        &lt;span class="kwrd"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;Content&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;
      &lt;span class="kwrd"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;ajx:AccordionPane&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;
   &lt;span class="kwrd"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;Panes&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;
  &lt;span class="kwrd"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;ajx:Accordion&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;
  &lt;span class="kwrd"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;div&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;
&lt;span class="kwrd"&gt;&amp;lt;/&lt;/span&gt;&lt;span class="html"&gt;asp:Content&lt;/span&gt;&lt;span class="kwrd"&gt;&amp;gt;&lt;/span&gt;
&lt;/pre&gt;
&lt;!--p align="center"&gt;&lt;img src="../ForDownload/WebNeck_2009-01-30_a.gif" mce_src="../ForDownload/WebNeck_2009-01-30_a.gif" alt="AcctMenu.Master.aspx Markup" Title="AcctMenu.Master.aspx Markup" /&gt;&lt;/br&gt;&lt;/p --&gt;
&lt;p&gt;This is the server-side code in: [AcctMenu.Master.cs]&lt;/p&gt;
&lt;pre class="csharpcode"&gt;&lt;span class="kwrd"&gt;using&lt;/span&gt; System;
&lt;span class="kwrd"&gt;using&lt;/span&gt; System.Web;
&lt;span class="kwrd"&gt;using&lt;/span&gt; System.Web.UI;
&lt;span class="kwrd"&gt;using&lt;/span&gt; System.Web.UI.WebControls;
&lt;span class="kwrd"&gt;using&lt;/span&gt; System.Web.UI.WebControls.WebParts;
&lt;span class="kwrd"&gt;using&lt;/span&gt; System.Web.UI.HtmlControls;

&lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;partial&lt;/span&gt; &lt;span class="kwrd"&gt;class&lt;/span&gt; AcctgMenu : System.Web.UI.MasterPage
{
  &lt;span class="kwrd"&gt;protected&lt;/span&gt; &lt;span class="kwrd"&gt;void&lt;/span&gt; Page_Load(&lt;span class="kwrd"&gt;object&lt;/span&gt; sender, EventArgs e)
  {
    DateDisplay.Text = DateTime.Now.ToString(&lt;span class="str"&gt;"dddd, MMMM dd"&lt;/span&gt;);
    &lt;span class="kwrd"&gt;if&lt;/span&gt; (!IsPostBack)
    {
      &lt;span class="kwrd"&gt;if&lt;/span&gt; (Session[&lt;span class="str"&gt;"accAccounting.SelectedIndex"&lt;/span&gt;] != &lt;span class="kwrd"&gt;null&lt;/span&gt;)
      {
        AccountingMenu.SelectedIndex = (&lt;span class="kwrd"&gt;int&lt;/span&gt;)Session[&lt;span class="str"&gt;"accAccounting.SelectedIndex"&lt;/span&gt;];
      }
    }
  }

  &lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;void&lt;/span&gt; SaveMenuIndex()
  {
    Session[&lt;span class="str"&gt;"accAccounting.SelectedIndex"&lt;/span&gt;] = AccountingMenu.SelectedIndex;
  }

  &lt;span class="kwrd"&gt;public&lt;/span&gt; &lt;span class="kwrd"&gt;void&lt;/span&gt; MenuLinkButton_OnClick(&lt;span class="kwrd"&gt;object&lt;/span&gt; sender, EventArgs e)
  {
    SaveMenuIndex();
    Response.Redirect(((LinkButton)sender).CommandArgument);
  }
}
&lt;/pre&gt;
&lt;p&gt;&lt;!-- p align="center"&gt;&lt;img src="../ForDownload/WebNeck_2009-01-30_b.gif" mce_src="../ForDownload/WebNeck_2009-01-30_b.gif" alt="AcctMenu.Master.aspx.cs server-side code" Title="AcctMenu.Master.aspx.cs server-side code" /&gt;&lt;/br&gt;&lt;/p --&gt;&lt;/p&gt;
&lt;h2&gt;the Way this thing works:&lt;/h2&gt;
&lt;ul&gt;
&lt;li&gt;&lt;strong&gt;Page_Load()&lt;/strong&gt; - the session variable 'accAccounting.SelectedIndex' is checked to see if it exists and if it has been set. If not, it will use whatever was set in the control as the default. Otherwise it will use the session variable to open the desired pane.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;MenuLinkButton_OnClick()&lt;/strong&gt; - this is called whenever a menu item was launched (you can see that this event was added to all the LinkButtons in the Accordion control). The first thing that happens is SaveMenuIndex() is called which will set the session variable, then the link is launched.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;SaveMenuIndex()&lt;/strong&gt; - this function sets/creates the session variable whenever it is called with the value of Accordion Control selected pane. In our case, it is only when a menu item is launched.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;&lt;strong&gt;The key&lt;/strong&gt;: is using a session variable for the departmental menu, we didn't want to use cookies in case the user's browser had them turned off. Also, we chose this method in case we decide on generating these menus dynamically and we now know what's needed (the OnClick event in the LinkButton).&lt;/p&gt;
&lt;p&gt;You can now add this Accordion control to other departmental.master's menus ...even if it only has a single pane in order to maintain the style used throughout the entire site (who knows you may need to add another pain in the future (&lt;em&gt;ah... we mean pane&lt;/em&gt;) to the control).&lt;/p&gt;
&lt;p&gt;&lt;a href="http://www.thewebpepper.net/file.axd?file=2010%2f1%2fWebNeck_2009-01-30.gif"&gt;Screen Shot (29.41 kb)&lt;/a&gt;&lt;br /&gt;&lt;a href="http://www.thewebpepper.net/file.axd?file=2010%2f1%2fWebPageMaster_2009-01-30.zip"&gt;WebPageMaster Project w/Accordian Menu Download (959.90 kb)&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;!-- And... comments are always welcome, the good and the bad. --&gt;&lt;strong&gt;&lt;em&gt;the WebPepper team&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/theWebNeck/~4/mFMFskotJ4U" height="1" width="1"/&gt;</description>
      <link>http://feedproxy.google.com/~r/theWebNeck/~3/mFMFskotJ4U/post.aspx</link>
      <author>the WebNeck</author>
      <comments>http://www.thewebpepper.net/post/2010/01/31/Accordion-Menu-within-a-Nested-Master-Page.aspx#comment</comments>
      <guid isPermaLink="false">http://www.thewebpepper.net/post.aspx?id=648bfb13-ff89-47e7-aadf-56545d12cc1f</guid>
      <pubDate>Sun, 31 Jan 2010 02:22:00 +0500</pubDate>
      <category>ASP .Net</category>
      <category>MasterPages</category>
      <dc:publisher>the WebNeck</dc:publisher>
      <pingback:server>http://www.thewebpepper.net/pingback.axd</pingback:server>
      <pingback:target>http://www.thewebpepper.net/post.aspx?id=648bfb13-ff89-47e7-aadf-56545d12cc1f</pingback:target>
      <slash:comments>0</slash:comments>
      <trackback:ping>http://www.thewebpepper.net/trackback.axd?id=648bfb13-ff89-47e7-aadf-56545d12cc1f</trackback:ping>
      <wfw:comment>http://www.thewebpepper.net/post/2010/01/31/Accordion-Menu-within-a-Nested-Master-Page.aspx#comment</wfw:comment>
      <wfw:commentRss>http://www.thewebpepper.net/syndication.axd?post=648bfb13-ff89-47e7-aadf-56545d12cc1f</wfw:commentRss>
    <feedburner:origLink>http://www.thewebpepper.net/post.aspx?id=648bfb13-ff89-47e7-aadf-56545d12cc1f</feedburner:origLink></item>
    <item>
      <title>Nested Master Pages, Embedded Links to fill ContentPlaceHolders</title>
      <description>&lt;p&gt;&lt;a href="http://www.thewebpepper.net/file.axd?file=2010%2f1%2fWebNeck_2009-25-01.zip"&gt;MasterPages Demo Project Download (33.24 kb)&lt;/a&gt;&lt;br /&gt;&lt;a href="http://www.thewebpepper.net/file.axd?file=2010%2f1%2fWebNeck_2009-25-01.png"&gt;Demo Screen Shot (90.06 kb)&lt;/a&gt;&lt;/p&gt;
&lt;h2&gt;Master Pages (1&lt;sup&gt;st&lt;/sup&gt; of a Series)&lt;/h2&gt;
&lt;p&gt;Have you been searching for a decent sample project that implements &lt;strong&gt;Nested Master Pages&lt;/strong&gt;? Hard to find ...huh! &lt;span style="text-decoration: underline;"&gt;Now, you got one!&lt;/span&gt;&lt;/p&gt;
&lt;p&gt;Here, nested MasterPages are implemented within a application framework of four panes: the first pane, the header holding the main menu, choices made from here load the side menu in the second pane, the choices here populate the content pane and of course, there is the footer pane to hold the copyright, app version and revision info, etc. (here - ASP.net)&lt;/p&gt;
&lt;p align="center"&gt;&lt;img title="Screen Dump" src="http://www.thewebpepper.com/ForDownload/WebNeck_2009-25-01.gif" alt="MasterPage Demo Screen Shot" /&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Building the App: &lt;/strong&gt;The approach taken was first create a page that looks like the screen-shot shown above. By doing this, you're able to setup up your cascading style sheet (css) and visually see the grouping of the panels within the html markup which will be replaced by your [ContentPlaceHolder] controls in the Master Pages. In order to get a grip on this and to keep it simple:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;no server-side coding was done&lt;/li&gt;
&lt;li&gt;no database connection&lt;/li&gt;
&lt;li&gt;no javascript&lt;/li&gt;
&lt;li&gt;and no sitemap&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;In a real world app, these would be a necessity, to validate user credentials, populating content, error checking, etc.&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;You might ask "Why wasn't a site-map used?"&lt;/strong&gt; The first reason is so you can get a handle on how embedded links are handled, with master pages it is a little different. Second, if there is a need to create the menus dynamically, lets say, in the Page_Load(), the hard-coded links are there to show you what is needed to get things working.&lt;/p&gt;
&lt;p&gt;Various sections of the app are put into different folders based on the main menu in the header pane. (The demo could have slapped all the files in the root but then, the demo would suck and not accomplish a thing...) Also, all the Master Pages are to be stuffed in the [MasterStuff] folder to mix things up a bit. So this is our demo layout:&lt;/p&gt;
&lt;p&gt;&lt;img title="Folder Layout" src="http://www.thewebpepper.com/ForDownload/WebNeck_2009-25-01_a.gif" alt="Folders" /&gt;&lt;/p&gt;
&lt;p&gt;The Master Page for the site (Site.Master) controls these sections: Header and Footer with a [ContentPlaceHolder] to populate both the side menu and content areas.&lt;/p&gt;
&lt;p align="center"&gt;&lt;img title="Site Master" src="http://www.thewebpepper.com/ForDownload/WebNeck_2009-25-01_b.gif" alt="Folders" /&gt;&lt;/p&gt;
&lt;p&gt;To populate the [ContentPlaceHolder] of the Site.Master, each menu item in the header calls the associated page which has its own Master Page and is a child of the site Master Page. Since these pages are children of the site Master, they only populate/update that defined area (with the help of the css):&lt;/p&gt;
&lt;p align="center"&gt;&lt;img title="Child Master(s)" src="http://www.thewebpepper.com/ForDownload/WebNeck_2009-25-01_c.gif" alt="Folders" /&gt;&lt;/p&gt;
&lt;p&gt;As you go through the code of the Demo site and get familiar with what does what, you will see that the html markup is self-explanatory... Have Fun!&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;The key for embedded links is:&lt;/strong&gt;&lt;/p&gt;
&lt;div class="tip"&gt;
&lt;pre&gt;runat="server"&lt;/pre&gt;
and if left out, the relative paths would be 'out-of-wack' due to how MasterPages are assembled. &lt;br /&gt; &lt;strong&gt;Tip:&lt;/strong&gt;&amp;nbsp;&amp;nbsp;For an excellent article to find out more on Master Pages and how they are assembled behind the scenes check out: &lt;a style="color:black; text-decoration:underline;" rel="nofollow" href="http://odetocode.com/articles/450.aspx" target="_blank"&gt;ASP.Net 2.0-Master Pages: Tips, Tricks, and Traps&lt;/a&gt; by K. Scott Allen&lt;/div&gt;
&lt;p&gt;&lt;a href="http://www.thewebpepper.net/file.axd?file=2010%2f1%2fWebNeck_2009-25-01.png"&gt;Demo Screen Shot (90.06 kb)&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;a href="http://www.thewebpepper.net/file.axd?file=2010%2f1%2fWebNeck_2009-25-01.zip"&gt;MasterPages Demo Project Download (33.24 kb)&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;&lt;!-- And... comments are always welcome, the good and the bad. --&gt;&lt;strong&gt;&lt;em&gt;the WebPepper team&lt;/em&gt;&lt;/strong&gt;&lt;/p&gt;&lt;img src="http://feeds.feedburner.com/~r/theWebNeck/~4/R9146KAdUQA" height="1" width="1"/&gt;</description>
      <link>http://feedproxy.google.com/~r/theWebNeck/~3/R9146KAdUQA/post.aspx</link>
      <author>the WebNeck</author>
      <comments>http://www.thewebpepper.net/post/2010/01/24/MasterPages-Nested-Download-Sample-Tutorial-Example-Sample.aspx#comment</comments>
      <guid isPermaLink="false">http://www.thewebpepper.net/post.aspx?id=40f9ef64-27c9-4060-afd9-abc20e2b96da</guid>
      <pubDate>Sun, 24 Jan 2010 05:04:00 +0500</pubDate>
      <category>ASP .Net</category>
      <category>MasterPages</category>
      <dc:publisher>the WebNeck</dc:publisher>
      <pingback:server>http://www.thewebpepper.net/pingback.axd</pingback:server>
      <pingback:target>http://www.thewebpepper.net/post.aspx?id=40f9ef64-27c9-4060-afd9-abc20e2b96da</pingback:target>
      <slash:comments>0</slash:comments>
      <trackback:ping>http://www.thewebpepper.net/trackback.axd?id=40f9ef64-27c9-4060-afd9-abc20e2b96da</trackback:ping>
      <wfw:comment>http://www.thewebpepper.net/post/2010/01/24/MasterPages-Nested-Download-Sample-Tutorial-Example-Sample.aspx#comment</wfw:comment>
      <wfw:commentRss>http://www.thewebpepper.net/syndication.axd?post=40f9ef64-27c9-4060-afd9-abc20e2b96da</wfw:commentRss>
    <feedburner:origLink>http://www.thewebpepper.net/post.aspx?id=40f9ef64-27c9-4060-afd9-abc20e2b96da</feedburner:origLink></item>
  </channel>
</rss>

