Friday, May 21, 2004

Many developers use Panels to programmatically show and hide different sections of a page, such as for a multi-step wizard interface or different areas of administration. Here is a series of overloaded methods I came up with for making it easier to show and hide Panels on a page.  You'll notice that some of the overloads include a parent control, for cases where you need to show/hide a Panel inside another Panel or PlaceHolder.

1  #region private void ShowPanel(...)   
2
3  private void HideAllPanels(Control parent)
4  {
5   foreach (Control c in parent.Controls)
6   {
7    if (c is Panel)
8    {
9     c.Visible = false;
10    }
11   }
12  }
13
14  private void ShowPanel(Panel showPanel)
15  {
16   ShowPanel(showPanel, this);
17  }
18
19  private void ShowPanel(Panel showPanel, Control parent)
20  {
21   foreach(Control c in parent.Controls)
22   {
23    if (c is Panel)
24    {
25     c.Visible = (c == showPanel);
26    }
27   }
28
29  }
30
31  private void ShowPanel(string panelID)
32  {
33   ShowPanel(panelID, this);
34  }
35
36  private void ShowPanel(string panelID, Control parent)
37  {
38   Panel p = (Panel) parent.FindControl(panelID);
39   ShowPanel(p, parent);
40  }
41  #endregion
Friday, May 21, 2004 2:16:00 PM (Central Standard Time, UTC-06:00)  #    Disclaimer  |  Comments [0]  | 

I sure wish I could afford one of these!

http://www.poetictech.com

http://www.mypce.com

Friday, May 21, 2004 11:54:00 AM (Central Standard Time, UTC-06:00)  #    Disclaimer  |  Comments [3]  | 
 Wednesday, May 19, 2004

Why haven't I blogged more?

I've been asking myself that question the last couple of weeks.  I had such great aspirations when I created this Web site and my own Blog engine.  I could say that I've been too busy.  Yes, I have been very busy, but, I think that is a cop out.  Just how much time and effort does it really take to make an entry?

No, I think the real issue is I haven't decided yet who my audience is.  I don't have someone, real or fictional, that I imagine to be my reader.  I think it would be much easier and more natural, if I could imagine I was writing an email to a good friend.

Once I discover who my reader is, then I think I'll have a story to tell.

Wednesday, May 19, 2004 7:11:00 AM (Central Standard Time, UTC-06:00)  #    Disclaimer  |  Comments [4]  |