Question

Loop through the controls on an ASP.NET page using a Master Page

Asked by: CipherIS

I have a webpage that is utilizing a Master Page.

I am utilizing the following code below.  I want to set the check box values = False.  I am receiving the following error dispalyed in the JPG.

Private Sub SetCheckToFalse()
 
    For Each ctrl As Control In Parent.Controls
        If TypeOf ctrl Is CheckBox Then
            CType(ctrl, CheckBox).Checked = False
        End If
    Next
 
End Sub
                                  
1:
2:
3:
4:
5:
6:
7:
8:
9:

Select allOpen in new window

This Question has been solved and asker verified All Experts Exchange premium technology solutions are available to subscription members.

Subscribe now for full access to Experts Exchange and get

Instant Access to this Solution

  • Plus...
  • 30 Day FREE access, no risk, no obligation
  • Collaborate with the world's top tech experts
  • Unlimited access to our exclusive solution database
  • Never be left without tech help again

Subscribe Now

Asked On
2008-08-21 at 06:59:57ID23666737
Tags

Microsoft

,

VS 2005

,

2005

,

VB.NET

Topics

Microsoft Visual Basic.Net

,

Programming for ASP.NET

Participating Experts
2
Points
500
Comments
37

Trusted by hundreds of thousands everyday for fast, accurate and reliable tech support.

  • "The time we save is the biggest benefit of Experts Exchange to Warner Bros. What could take multiple guys 2 hours or more each to find is accessed in around 15 minutes on Experts Exchange." Mike Kapnisakis, Warner Bros.
  • "Our team likes having a resource that is more secure than just using Google and most experts using this service really know their stuff. It's nice to look here first versus using Google." Dayna Sellner, Lockheed Martin
  • "Anytime that I've been stumped with a problem, 9 out of 10 times Experts Exchange has either the accepted solution or an open discussion of the potential solution to the problem." Kenny Red, eBay Inc.

See what Experts Exchange can do for you.

Got a question?

We've got the answer.

Experts Exchange has been collecting answers to technology questions since 1996…3 million and counting! If you have a question, chances are we already have your answer.

Screenshot of Experts Exchange Knowledgebase

Need individual assistance?

Our experts are ready to help.

If you can't find the exact answer you're looking for, ask our exclusive community of 50,000 experts. You’ll get a personalized answer from a trusted professional.

Screenshot of Experts Exchange Knowledgebase

Want to learn from the best?

Read articles from industry experts.

Thousands of free tech tips, tricks, how-to’s and tutorials are available in our peer reviewed articles section. See for yourself how smart our experts are, no login required.

Screenshot of an Article

Working on a long term project?

Store your work and research.

Save solutions to your questions, answers you’ve discovered through searching plus helpful articles in your personal knowledgebase for easy future access.

Screenshot of Experts Exchange Knowledgebase

Access the answers to your technology questions today.

Subscribe Now

30-day free trial. Register in 60 seconds.

What Makes Experts Exchange Unique?

Members of the expert community talk about why the experience at Experts Exchange is different than what you will find anywhere else.

Trusted by the world's most respected brands.

image of each brand's logo

Faithfully serving IT professionals since 1996.

Experts Exchange Logo

Try it out and discover for yourself.

Subscribe Now

30-day free trial. Register in 60 seconds.

Related Solutions

  1. Master Browser
    Hello, I am getting messages in the evet viewer that the master browser has received a server announcement from the computer1 that believes is the master browser for the domain. Anybody has any idea how can i fix it. How can I find out which computer is a master browser. I...
  2. master pages
    i have just learnt about master pages in asp.net. in php you include files in a webpage eg header file,left-side-navigation file , footer file etc. q1)is this asp.nets versions of this? can you include files in asp.net like i just mentioned i php? q2)is there a downside to ...
  3. Asp.net,vb.net /master page
    How can I add a master page in asp.net application file ,e.g, file.aspx if it is not already it it? what is the code for it. The master page already exists but it is not linked to one file but linked to others.
  4. Application. Master
    I created two master pages Custom. Master and Application. Master referencing CSS placed under _styles folder in SharePoint designer Custom. Master will be used for all the pages and Application. Master will be used by all the admin pages (Correct me if am wrong) I have no ...
  5. Master pages
    what is the basic purpose of master pages in asp.net

Free Tech Articles

  1. WARNING: 5 Reasons why you should NEVER fix a computer for free.
    It is in our nature to love the puzzle. We are obsessed. The lot of us. We love puzzles. We love the challenge. We thrive on finding the answer. We hate disarray. It bothers us deep in our soul. W...
  2. SCCM OSD Basic troubleshooting
    SCCM 2007 OSD is a fantastic way to deploy operating systems, however, like most things SCCM issues can sometimes be difficult to resolve due to the sheer volume of logs to sift through and the dispe...
  3. Migrate Small Business Server 2003 to Exchange 2010 and Windows 2008 R2
    This guide is intended to provide step by step instructions on how to migrate from Small Business Server 2003 to Windows 2008 R2 with Exchange 2010. For this migration to work you will need the fo...
  4. Create a Win7 Gadget
    This article shows you how to create a simple "Gadget" -- a sort of mini-application supported by Windows 7 and Vista. Gadgets can be dropped anywhere on the desktop to provide instant information, ...
  5. Outlook continually prompting for username and password
    There have been a lot of questions recently regarding Outlook prompting for a username and password whilst using Exchange 2007. There are a few reasons why this would happen and I will try to cover t...
  6. Backup Exchange 2010 Information Store using Windows Backup
    There seems to be quite a lot of confusion around the ability to backup Exchange 2010 using the built in Windows Backup feature. This stems from the omission of this feature prior to Exchange 2007 s...

Cloud Class Webinars

  1. Avoiding Bugs in Microsoft Access
    Alison Balter takes and in-depth look at avoiding bugs in Access. In this webinar you will learn about using the immediate window to debug your applications, invoking the debugger, using breakpoints to troubleshoot, stepping through code, setting the next statement to execute, ...
  2. Top 10 Best New Features in Visio 2010
    Scott Helmers gives live demonstrations of the top 10 new features in Visio 2010. This webinar will teach you how to create compelling diagrams by adding shapes to the page with a single click, linking the shapes in a diagram to data in Excel (or SQL Server, or SharePoint), ...
  3. IT Consultant Business Secrets Revealed
    Michael Munger, Experts Exchange tech pro and IT consultant, pulls back the curtain on his very successful businesses and answers question on every IT consultant and business owner should know about. He shares secrets on what he did to solve the 5 most common problems in IT, ...
  4. Disaster Recovery and Business Continuity
    Quest CTO, Mike Billon, gives an overview of the steps involved in building a dunamic disaster recovery plan. Through case studies and an examination of software/hardware tooles for monitoring and testing, you'll gain a better understandin of where you are, where you want ...
  5. Organize Your Visio Diagrams with Containers and Lists
    Scott Helmers uses cross functional flowcharts, wireframe diagrams, data graphic legends and seating charts to teach you: how to ustilize all three new structured diagram components in Visio 2010, the best practices for organizeing shapes in previous version of Visio, how to organize ...
  6. How to Us Objects, Properties, Events and Methods in Microsoft Access
    Alison Dalter gives an in-depbth look at objects, properties, events and methods in Microsoft Access. In this webinar you will learn about using the object browser, referring to objects, working with properties and methods, working with object variables, understanding the ...

Join the Community

Give a Little. Get a Lot.

Join the community of experts here and help other tech pros by answering question in your area of expertise. You can earn FREE access to all Experts Exchange's premium features and resources.

Join the Community

Answers

 

by: CipherISPosted on 2008-08-21 at 07:04:22ID: 22279626

When I use "Me.Controls" or "Page.Controls" I receive the following error:  Unable to cast object of type 'ASP.index_master' to type 'System.Windows.Forms.Control'.

 

by: TimCotteePosted on 2008-08-21 at 07:12:09ID: 22279720

Hello CipherIS,

For Each ctrl As Object In Parent.Controls

Because you cannot guarantee that everything can be coerced to a control it is safe to use object though as this can accept any type.

Regards,

TimCottee

 

by: CipherISPosted on 2008-08-21 at 07:15:34ID: 22279752

Ok, I made the suggested changes as shown below and received the following error.

Private Sub SetCheckToFalse()
 
    For Each ctrl As Object In Parent.Controls
        If TypeOf ctrl Is CheckBox Then
            CType(ctrl, CheckBox).Checked = False
        End If
    Next
 
End Sub
                                              
1:
2:
3:
4:
5:
6:
7:
8:
9:

Select allOpen in new window

 

by: TimCotteePosted on 2008-08-21 at 07:18:31ID: 22279790

But you then need to use Page.Controls I guess. Serves me right for not reading thoroughly the first time.

 

by: CipherISPosted on 2008-08-21 at 07:22:56ID: 22279838

Hmmm, that resolved the error but it is not finding the controls

 

by: CipherISPosted on 2008-08-21 at 07:25:05ID: 22279862

It is looking for controls on the Master Page.  I need it to look for controls on the page that the control resides on

 

by: CipherISPosted on 2008-08-21 at 07:38:22ID: 22279995

Below is a snapshot to show that it is going to the Master page.  I need it to look at the controls on the Employee.aspx page

 

by: CipherISPosted on 2008-08-21 at 12:54:50ID: 22283704

Ok, I also tried the control below.  Though it doesn not error, it is not finding the checkboxes on my form.

Dim mstrPage As MasterPage = Me.Master
Dim cph As ContentPlaceHolder = mstrPage.FindControl("Main")
Dim up1 As UpdatePanel = cph.FindControl("UpdatePanel1")
If Not cph Is Nothing Then
    If Not up1 Is Nothing Then
        For Each c As Object In up1.Controls 'up1.Controls(0).Controls
            If TypeOf c Is CheckBox Then
                CType(c, CheckBox).Checked = False
            End If
        Next
    End If
End If
                                              
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:

Select allOpen in new window

 

by: CipherISPosted on 2008-08-21 at 15:54:32ID: 22285069

Can anyone help?

 

by: TheLearnedOnePosted on 2008-08-22 at 08:56:10ID: 22291315

I don't quite understand what you are looking for.  Are you trying to get all controls on the master page from the content page, or all the controls on the content page from the master page?

 

by: CipherISPosted on 2008-08-22 at 13:07:06ID: 22293667

I am using a Master Page - index.master.  I have code on another page employee.aspx.  In employment.aspx.vb I need to write code that will find the check boxes on the employee.aspx code.  Each code sample that I use above looks at the Master page.  I need to find the control (check boxes) on the employee.aspx form.

 

by: CipherISPosted on 2008-08-22 at 13:25:28ID: 22293821

If you look at 08.21.2008 at 10:38AM EDT, ID: 22279995  -  it will show you the code in the Employee.aspx.vb page.

 

by: TheLearnedOnePosted on 2008-08-22 at 14:09:28ID: 22294126

It looks like you are trying to find controls on an UpdatePanel.  Unfortunately, the UpdatePanel has a sub-container that confuses the issue.  You need to use FindControl from that sub-container to get any references to controls, or use a recursive find method that starts at the UpdatePanel, and works down to all the children recursively.

 

by: TheLearnedOnePosted on 2008-08-22 at 14:10:50ID: 22294132

I believe that I just confused the UpdatePanel with a TabPanel, and so ignore the above.   Are you able to debug that code in the index.master page, to see what it is finding, and what it isn't?

 

by: CipherISPosted on 2008-08-22 at 14:25:37ID: 22294214

This is the code that I am using.  And a detailed Error.

Public Sub SetCheckToFalse()
 
    For Each chkCheckBox As Control In Me.Controls
        If (TypeOf chkCheckBox Is CheckBox) Then
            CType(chkCheckBox, CheckBox).Checked = False
        End If
    Next chkCheckBox
 
End Sub

                                              
1:
2:
3:
4:
5:
6:
7:
8:
9:

Select allOpen in new window

 

by: CipherISPosted on 2008-08-22 at 14:35:46ID: 22294269

The error occurs on Me.Controls.  If I change to Page.Controls I receive the same error "Unable to Cast .....  to System.Windows.Forms.Control".  

I do not want to use the find control because I have about 30 check  boxes.  I am trying to avoid writing code like below

chkOne.checked = false
chkTwo.checked = false 
chkThree.checked = false
chkFour.checked = false 
chkFive.checked = false 
ETC...
                                              
1:
2:
3:
4:
5:
6:

Select allOpen in new window

 

by: TheLearnedOnePosted on 2008-08-23 at 15:09:19ID: 22298660

Aha, you have a reference to System.Windows.Forms, and this is ASP.NET, so it is finding the reference for the Windows Forms control before the web UI control class.  Do you need the reference to System.Windows.Forms in your project.

 

by: CipherISPosted on 2008-08-23 at 16:32:32ID: 22298911

I do not know why it is calling this reference.  I need it to find the controls on a web form.  How do I do that without using the Find Controls.  Why is it looking for System.Windows.Form when I am using a web form?

 

by: CipherISPosted on 2008-08-23 at 16:40:14ID: 22298934

Ok, I found what was causing it to set to System.Windows.Forms but I still can not find the check box controls on a page.

 

by: TheLearnedOnePosted on 2008-08-24 at 11:17:21ID: 22301578

You have to look at the entire control hierarchy, which is a tree structure.  If you are looking at top-level controls, you won't find anything.  Another short cut is to find the naming container that the controls are on, and use FindControl from that container to get a reference to the control that you need.

 

by: CipherISPosted on 2008-08-24 at 13:18:57ID: 22301933

Sorry, I am lost.

 

by: TheLearnedOnePosted on 2008-08-24 at 14:58:01ID: 22302182

Where is the CheckBox control defined that you are trying to get a reference to?

 

by: CipherISPosted on 2008-08-25 at 10:33:42ID: 22307396

I am using a Master Pages in my website.  

I have a page named Employee.aspx.  On this form I have 70 check boxes.  There are inside UpdatePanel1.

 

by: TheLearnedOnePosted on 2008-08-25 at 10:44:48ID: 22307482

1) Get a reference to the UpdatePanel:

Dim updatePanel1 As UpdatePanel = TryCast(Page.Form.FindControl("UpdatePanel1"), UpdatePanel)

2) Loop through the controls for the UpdatePanel:

   If updatePanel1 IsNot Nothing Then

      For Each ctl As Control In updatePanel.Controls
          If TypeOf ctl is CheckBox Then
              Dim chk As CheckBox = CType(ctl, CheckBox)
          End If
      Next ctl

   End If

 

by: CipherISPosted on 2008-08-25 at 18:14:34ID: 22310782

Still not working.  I am attaching the .vb file and the .aspx file.  I did rename the control from UpdatePanel1 to UpdatePanel

 

by: CipherISPosted on 2008-08-25 at 18:16:30ID: 22310792

Disregard my comments above.  The pictures are accuratel.  The ID of the control is UpdatePanel1.  No matter what I do the value is Nothing.  

Is this solvable?

 

by: TheLearnedOnePosted on 2008-08-25 at 18:55:28ID: 22310983

Ok, you are using a MasterPage, so the UpdatePanel is not on the page directly, it is contained by the ContentPlaceHolder.  When the page is rendered, look at the unique ID (View source in Browser), and it will be something like ctl00$ContentPlaceHolder1$UpdatePanel1.  You need to get a reference to the ContentPlaceHolder, then the UpdatePanel, and then the CheckBox controls.

 

by: CipherISPosted on 2008-08-26 at 05:47:03ID: 22313940

Let see if I understand this.

I know that the Master Page has a ContentPlaceHolder.  Employee.aspx uses the ContentPlaceHolder.  My code goes inside the ContentPlaceHolder on the Employee.aspx page.  So should my code be something like this?

Dim cph As ContentPlaceHolder = mstrPage.FindControl 
    ("ContentPlaceHolder1$UpdatePanel1")
Dim up1 As UpdatePanel = cph.FindControl("UpdatePanel1")
If Not cph Is Nothing Then
    If Not up1 Is Nothing Then
        For Each c As Object In up1.Controls 
            If TypeOf c Is CheckBox Then
                CType(c, CheckBox).Checked = False
            End If
        Next
    End If
End If

                                              
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:

Select allOpen in new window

 

by: TheLearnedOnePosted on 2008-08-26 at 07:11:04ID: 22314860

More like this:

Dim cph As ContentPlaceHolder = Page.Form.FindControl("ContentPlaceHolder1")
If Not cph Is Nothing Then
    Dim up1 As UpdatePanel = cph.FindControl("UpdatePanel1")
    If Not up1 Is Nothing Then
        For Each c As Object In up1.Controls 
            If TypeOf c Is CheckBox Then
                CType(c, CheckBox).Checked = False
            End If
        Next
    End If
End If

                                              
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:

Select allOpen in new window

 

by: CipherISPosted on 2008-08-26 at 17:33:39ID: 22320919

Still not working.  Here are screen shots

 

by: TheLearnedOnePosted on 2008-08-27 at 06:02:43ID: 22324233

Can you paste in the HTML from the designer for the UpdatePanel, please?

 

by: CipherISPosted on 2008-08-27 at 18:30:10ID: 22330680

Here it is

<%@ Page Language="VB" MasterPageFile="~/Index.master" AutoEventWireup="false" CodeFile="Employee.aspx.vb"
    Inherits="Employee" %>
 
I TOOK OUT THE OTHER REFERENCES HERE
 
<asp:Content ID="Content1" ContentPlaceHolderID="Main" runat="Server">
<asp:UpdatePanel ID="UpdatePanel1" runat="server"> <ContentTemplate>
<DIV class="msgarea">
 
<TABLE cellSpacing=0 cellPadding=0 width="100%" border=0>
<TBODY>
<TR>
<TD style="WIDTH: 1%"><IMG height=82 alt="Employee Information" src="./images/emp_on.jpg" width=115 /> </TD>
<TD style="WIDTH: 420px; TEXT-ALIGN: left">
<asp:Label style="TEXT-ALIGN: center" id="lblError01" runat="server" Visible="False" BackColor="Yellow" Font-Bold="True" ForeColor="#C00000" Text="lblError01" Width="100%"></asp:Label> 
</TD>
<TD>
<asp:ImageButton id="cmdExit" runat="server" ImageUrl="images/ch_button_exit.png"></asp:ImageButton></TD>
</TR>
</TBODY>
</TABLE>
</DIV>
<DIV class="tabarea">
<ComponentArt:TabStrip id="EmployeeTabStrip" runat="server" AutoPostBackOnSelect="true" 
OnItemSelected="EmployeeTabStrip_ItemSelected" CssClass="TopGroup" SiteMapXmlFile="EmployeeTabData.xml" 
DefaultItemLookId="DefaultTabLook" DefaultSelectedItemLookId="SelectedTabLook" 
DefaultDisabledItemLookId="DisabledTabLook" DefaultGroupTabSpacing="0" ImagesBaseUrl="images/tabs/v1/"> 
  <ItemLooks> 
  <ComponentArt:ItemLook LookId="DefaultTabLook" CssClass="DefaultTab" HoverCssClass="DefaultTabHover" LabelPaddingLeft="10" 
  LabelPaddingRight="10" LabelPaddingTop="3" LabelPaddingBottom="3" LeftIconUrl="tab_left_icon.png" 
  RightIconUrl="tab_right_icon.png" HoverLeftIconUrl="hover_tab_left_icon.gif" HoverRightIconUrl="hover_tab_right_icon.gif" 
  LeftIconWidth="5" LeftIconHeight="19" RightIconWidth="5" RightIconHeight="19" /> 
  <ComponentArt:ItemLook LookId="SelectedTabLook" CssClass="SelectedTab" LabelPaddingLeft="10" LabelPaddingRight="10" 
  LabelPaddingTop="3" LabelPaddingBottom="3" LeftIconUrl="selected_tab_left_icon.gif" RightIconUrl="selected_tab_right_icon.gif" 
   LeftIconWidth="5" LeftIconHeight="19" RightIconWidth="5" RightIconHeight="19" /> 
  <ComponentArt:ItemLook LookId="DisabledTabLook" CssClass="DisabledTab" LabelPaddingLeft="10" LabelPaddingRight="10" 
  LabelPaddingTop="3" LabelPaddingBottom="3" LeftIconUrl="tab_left_icon.png" RightIconUrl="tab_right_icon.png" 
  LeftIconWidth="5" LeftIconHeight="19" RightIconWidth="5" RightIconHeight="19" /> 
  </ItemLooks> </ComponentArt:TabStrip> </DIV><DIV style="LEFT: 5px; WIDTH: 664px; TOP: 0px; HEIGHT: 431%" id="DIV1" class="formarea" onclick="return DIV1_onclick()">
<TABLE style="MARGIN: 8px 15px" cellSpacing=0 cellPadding=0 width=600 border=0><TBODY><TR><TD style="WIDTH: 300px" vAlign=top>
<TABLE width=300 border=0><TBODY><TR><TD style="WIDTH: 300px; BACKGROUND-COLOR: #eeeeee; TEXT-ALIGN: center">
<asp:Label id="lblEmpId" runat="server" Text="Employee Identification" CssClass="formlabels"></asp:Label></TD></TR><TR><TD>
<TABLE width="100%" border=0><TBODY><TR><TD style="WIDTH: 120px; TEXT-ALIGN: right">
<asp:Label id="lblEmpIdNo" runat="server" Text="Employee Id Number:" CssClass="formlabels"></asp:Label> &nbsp;</TD><TD>
<asp:TextBox id="txtEmpIdNo" runat="server" Width="174px" MaxLength="20" AutoPostBack="True"></asp:TextBox></TD></TR><TR><TD style="WIDTH: 120px; TEXT-ALIGN: right">
<asp:Label id="lblOccupation" runat="server" Text="Occupation:" CssClass="formlabels"></asp:Label> &nbsp;</TD><TD>
<asp:DropDownList id="cboOccupation" runat="server" Width="174px"></asp:DropDownList></TD></TR><TR><TD style="WIDTH: 120px; TEXT-ALIGN: right">
<asp:Label id="lblSWGroup" runat="server" Text="Software Group:" CssClass="formlabels"></asp:Label> &nbsp;</TD><TD>
<asp:DropDownList id="cboSWGroup" runat="server" Width="174px" AutoPostBack="True" OnSelectedIndexChanged="SetPrivileges"></asp:DropDownList></TD></TR></TBODY></TABLE></TD></TR></TBODY></TABLE></TD><TD style="WIDTH: 300px" vAlign=top align=right>
<TABLE width=300 border=0><TBODY><TR><TD style="WIDTH: 300px; BACKGROUND-COLOR: #eeeeee; TEXT-ALIGN: center">
<asp:Label id="lblWorkAreaInfo" runat="server" Text="Work Area Information" CssClass="formlabels"></asp:Label></TD></TR><TR><TD>
<TABLE width="100%" border=0><TBODY><TR><TD style="WIDTH: 120px; TEXT-ALIGN: right">
<asp:Label id="lblDept" runat="server" Text="Department" CssClass="formlabels"></asp:Label> &nbsp;</TD><TD>
<asp:DropDownList id="cboDept" runat="server" Width="174px"> </asp:DropDownList></TD></TR><TR><TD style="WIDTH: 120px; TEXT-ALIGN: right">
<asp:Label id="lblSection" runat="server" Text="Section" CssClass="formlabels"></asp:Label> &nbsp;</TD><TD>
<asp:DropDownList id="cboSection" runat="server" Width="174px"> </asp:DropDownList></TD></TR><TR><TD style="WIDTH: 120px; TEXT-ALIGN: right">
<asp:Label id="lblSupervisor" runat="server" Text="Supervisor" CssClass="formlabels"></asp:Label> &nbsp;</TD><TD>
<asp:DropDownList id="cboSupervisor" runat="server" Width="174px"></asp:DropDownList></TD></TR></TBODY></TABLE></TD></TR></TBODY></TABLE></TD></TR><TR><TD style="WIDTH: 277px">
<TABLE cellSpacing=0 cellPadding=0 border=0><TBODY><TR><TD align=center>
<TABLE width=300 border=0><TBODY><TR><TD style="WIDTH: 300px; BACKGROUND-COLOR: #eeeeee; TEXT-ALIGN: center">
<asp:Label id="lblEmployeeName" runat="server" Text="Employee Name & Dates" CssClass="formlabels"></asp:Label> </TD></TR><TR><TD>
<TABLE width="100%" border=0><TBODY><TR><TD style="WIDTH: 120px; TEXT-ALIGN: right">
<asp:Label id="lblFirstName" runat="server" Text="First" CssClass="formlabels"></asp:Label> , 
<asp:Label id="lblMiddleInitial" runat="server" Text="Middle Initial" CssClass="formlabels"></asp:Label> &nbsp;</TD><TD>
<asp:TextBox id="txtFirstName" runat="server" Width="130px" MaxLength="20"></asp:TextBox> 
<asp:TextBox id="txtMiddleInitial" runat="server" Width="40px" MaxLength="1"></asp:TextBox></TD></TR><TR><TD style="WIDTH: 120px; TEXT-ALIGN: right">
<asp:Label id="lblLastName" runat="server" Text="Last" CssClass="formlabels"></asp:Label> &nbsp;</TD><TD>
<asp:TextBox id="txtLastName" runat="server" Width="174px" MaxLength="20"></asp:TextBox></TD></TR><TR><TD style="WIDTH: 120px; TEXT-ALIGN: right">
<asp:Label id="lblEMail" runat="server" Text="E-Mail Address:" CssClass="formlabels"></asp:Label> &nbsp;</TD><TD>
<asp:TextBox id="txtEMail" runat="server" Width="174px" MaxLength="50"></asp:TextBox></TD></TR><TR><TD style="WIDTH: 120px; TEXT-ALIGN: right">
<asp:Label id="lblPhoneNo" runat="server" Text="PhoneNo" CssClass="formlabels"></asp:Label> , 
<asp:Label id="lblExt" runat="server" Text="Ext:" CssClass="formlabels"></asp:Label> &nbsp;</TD><TD>
<asp:TextBox id="txtPhoneNo" runat="server" Width="130px" MaxLength="12"></asp:TextBox> 
<asp:TextBox id="txtExt" runat="server" Width="40px" MaxLength="4"></asp:TextBox></TD></TR><TR><TD style="WIDTH: 120px; TEXT-ALIGN: right">
<asp:Label id="lblHiredDate" runat="server" Text="Hired Date:" CssClass="formlabels"></asp:Label> &nbsp;</TD><TD>
<asp:TextBox style="BORDER-RIGHT: 0px; BORDER-TOP: 0px; BORDER-LEFT: 0px; BORDER-BOTTOM: 0px" id="calHiredDate" runat="server" Width="130px" CssClass="fixed" Enabled="False"></asp:TextBox> 
<asp:Image id="Image1" runat="Server" ImageUrl="~/Images/Calendar_scheduleHS.png" ImageAlign="AbsMiddle"></asp:Image></TD></TR><TR><TD style="WIDTH: 120px; TEXT-ALIGN: right">
<asp:Label id="lblTermDate" runat="server" Text="Termination Date:" CssClass="formlabels"></asp:Label> &nbsp;</TD><TD>
<asp:TextBox style="BORDER-RIGHT: 0px; BORDER-TOP: 0px; BORDER-LEFT: 0px; BORDER-BOTTOM: 0px" id="calTermDate" runat="server" Width="130px" CssClass="fixed" Enabled="False"></asp:TextBox> 
<asp:Image id="Image2" runat="Server" ImageUrl="~/Images/Calendar_scheduleHS.png" ImageAlign="AbsMiddle"></asp:Image></TD></TR><TR><TD style="WIDTH: 120px; TEXT-ALIGN: right">
<asp:Label id="lblTempEmp" runat="server" Text="Temp. Employee:" CssClass="formlabels"></asp:Label> &nbsp;</TD><TD style="PADDING-RIGHT: 0px; PADDING-LEFT: 0px; PADDING-BOTTOM: 0px; PADDING-TOP: 0px">
<TABLE style="WIDTH: 100%" cellSpacing=0 cellPadding=0 border=0><TBODY><TR><TD style="WIDTH: 5%; TEXT-ALIGN: left" align=left>
  
<asp:CheckBox id="chkTempEmp" runat="server" Text="" AutoPostBack="True">
</asp:CheckBox></TD><TD style="WIDTH: 90%; TEXT-ALIGN: right">
<asp:Label id="lblIsSupervisor" runat="server" Text="Manager/Supervisor:" CssClass="formlabels"></asp:Label> &nbsp;</TD><TD style="WIDTH: 5%; TEXT-ALIGN: right">
<asp:CheckBox id="chkSupervisor" runat="server" Text="" AutoPostBack="True"></asp:CheckBox></TD></TR></TBODY></TABLE></TD></TR></TBODY></TABLE></TD></TR></TBODY></TABLE></TD></TR></TBODY></TABLE></TD><TD vAlign=top align=right>
<TABLE width=300 border=0><TBODY><TR><TD style="WIDTH: 300px; BACKGROUND-COLOR: #eeeeee; TEXT-ALIGN: center">
<asp:Label id="lblEmployeeDates" runat="server" Text="Privileges" CssClass="formlabels"></asp:Label> </TD></TR><TR><TD>
<TABLE class="frame" width="100%" border=0><TBODY><TR><TD>
<asp:CheckBox id="chkActOwner" runat="server" Text=""></asp:CheckBox> 
<asp:Label id="lblActOwner" runat="server" Text="Activity Owner" CssClass="formlabels"></asp:Label> <BR /><BR />
<asp:CheckBox id="chkAuditLdr" runat="server" Text=""></asp:CheckBox> 
<asp:Label id="lblAuditLd" runat="server" Text="Audit Leader" CssClass="formlabels"></asp:Label> <BR /><BR />
<asp:CheckBox id="chkTaskOwn" runat="server" Text=""></asp:CheckBox> 
<asp:Label id="lblTaskOwn" runat="server" Text="Task Owner" CssClass="formlabels"></asp:Label> <BR /><BR />
<asp:CheckBox id="chkInitInvestigate" runat="server" Text=""></asp:CheckBox> 
<asp:Label id="lblInitInvestigate" runat="server" Text="Initiate Investigation" CssClass="formlabels"></asp:Label> </TD><TD>
<asp:CheckBox id="chkToDoOwn" runat="server" Text=""></asp:CheckBox> 
<asp:Label id="lblToDoOw" runat="server" Text="'To-Do' Owner" CssClass="formlabels"></asp:Label> <BR /><BR />
<asp:CheckBox id="chkInvestigateRoute" runat="server" Text=""></asp:CheckBox> 
<asp:Label id="lblInvestigateRoute" runat="server" Text="Investigation Routing" CssClass="formlabels"></asp:Label> <BR /><BR />
<asp:CheckBox id="chkAuditOwn" runat="server" Text=""></asp:CheckBox> 
<asp:Label id="lblAuditOwn" runat="server" Text="Audit Owner" CssClass="formlabels"></asp:Label> <BR /><BR />
<asp:CheckBox id="chkCloseToDo" runat="server" Visible="False" Text=""></asp:CheckBox> 
<asp:Label id="lblCloseToD" runat="server" Visible="False" Text="Close &quot;To-Do's&quot;" CssClass="formlabels"></asp:Label> <BR /></TD></TR></TBODY></TABLE></TD></TR></TBODY></TABLE></TD></TR></TBODY></TABLE>
<TABLE style="BORDER-RIGHT: 0px; PADDING-RIGHT: 2px; BORDER-TOP: 0px; PADDING-LEFT: 2px; PADDING-BOTTOM: 2px; BORDER-LEFT: 0px; WIDTH: 100%; PADDING-TOP: 2px; BORDER-BOTTOM: 0px"><TBODY><TR><TD style="HEIGHT: 25px; BACKGROUND-COLOR: #eeeeee; TEXT-ALIGN: center">
<asp:Label id="lblBusinessRules" runat="server" Text="Business Rules" CssClass="formlabels"></asp:Label> </TD></TR><TR><TD style="TEXT-ALIGN: center">
<TABLE class="frame" width=550><TBODY><TR><TD>
<asp:Label id="lblSWModule" runat="server" ForeColor="Red" Text="Software Module" CssClass="formlabels"></asp:Label></TD><TD>
<asp:Label id="lblAdd" runat="server" ForeColor="Red" Text="Add" CssClass="formlabels"></asp:Label></TD><TD>
<asp:Label id="lblDel" runat="server" ForeColor="Red" Text="Del" CssClass="formlabels"></asp:Label></TD><TD>
<asp:Label id="lblUpd" runat="server" ForeColor="Red" Text="Upd" CssClass="formlabels"></asp:Label></TD><TD>
<asp:Label id="lblAcc" runat="server" ForeColor="Red" Text="Acc" CssClass="formlabels"></asp:Label></TD><TD style="WIDTH: 50px"></TD><TD>
<asp:Label id="lblSWModule2" runat="server" ForeColor="Red" Text="Software Module" CssClass="formlabels"></asp:Label></TD><TD>
<asp:Label id="lblAdd2" runat="server" ForeColor="Red" Text="Add" CssClass="formlabels"></asp:Label></TD><TD>
<asp:Label id="lblDel2" runat="server" ForeColor="Red" Text="Del" CssClass="formlabels"></asp:Label></TD><TD>
<asp:Label id="lblUpd2" runat="server" ForeColor="Red" Text="Upd" CssClass="formlabels"></asp:Label></TD><TD>
<asp:Label id="lblAcc2" runat="server" ForeColor="Red" Text="Acc" CssClass="formlabels"></asp:Label></TD></TR><TR><TD>
<asp:Label id="lblEmployeeInformation" runat="server" Text="Employee Information" CssClass="formlabels"></asp:Label></TD><TD>
<asp:CheckBox id="chkEmployeeAdd" runat="server" AutoPostBack="True" OnCheckedChanged="chk_CheckedChanged"></asp:CheckBox></TD><TD>
<asp:CheckBox id="chkEmployeeDel" runat="server" AutoPostBack="True" OnCheckedChanged="chk_CheckedChanged"></asp:CheckBox></TD><TD>
<asp:CheckBox id="chkEmployeeUpd" runat="server" AutoPostBack="True" OnCheckedChanged="chk_CheckedChanged"></asp:CheckBox></TD><TD>
<asp:CheckBox id="chkEmployeeAcc" runat="server" AutoPostBack="True" OnCheckedChanged="chk_CheckedUnChanged"></asp:CheckBox></TD><TD></TD><TD>
<asp:Label id="lblInvestigationsModule" runat="server" Text="Investigation Information" CssClass="formlabels"></asp:Label></TD><TD>
<asp:CheckBox id="chkInvestigationsAdd" runat="server" AutoPostBack="True" OnCheckedChanged="chk_CheckedChanged"></asp:CheckBox></TD><TD>
<asp:CheckBox id="chkInvestigationsDel" runat="server" AutoPostBack="True" OnCheckedChanged="chk_CheckedChanged"></asp:CheckBox></TD><TD>
<asp:CheckBox id="chkInvestigationsUpd" runat="server" AutoPostBack="True" OnCheckedChanged="chk_CheckedChanged"></asp:CheckBox></TD><TD>
<asp:CheckBox id="chkInvestigationsAcc" runat="server" AutoPostBack="True" OnCheckedChanged="chk_CheckedUnChanged"></asp:CheckBox></TD></TR><TR><TD>
<asp:Label id="lblFacilityInformation" runat="server" Text="Facility Information" CssClass="formlabels"></asp:Label></TD><TD>
<asp:CheckBox id="chkFacilityAdd" runat="server" AutoPostBack="True" OnCheckedChanged="chk_CheckedChanged"></asp:CheckBox></TD><TD>
<asp:CheckBox id="chkFacilityDel" runat="server" AutoPostBack="True" OnCheckedChanged="chk_CheckedChanged"></asp:CheckBox></TD><TD>
<asp:CheckBox id="chkFacilityUpd" runat="server" AutoPostBack="True" OnCheckedChanged="chk_CheckedChanged"></asp:CheckBox></TD><TD>
<asp:CheckBox id="chkFacilityAcc" runat="server" AutoPostBack="True" OnCheckedChanged="chk_CheckedUnChanged"></asp:CheckBox></TD><TD></TD><TD>
<asp:Label id="lblInvestigationsTask" runat="server" Text="Investigation Task" CssClass="formlabels"></asp:Label></TD><TD>
<asp:CheckBox id="chkInvestigationsTaskAdd" runat="server" AutoPostBack="True" OnCheckedChanged="chk_CheckedChanged"></asp:CheckBox></TD><TD>
<asp:CheckBox id="chkInvestigationsTaskDel" runat="server" AutoPostBack="True" OnCheckedChanged="chk_CheckedChanged"></asp:CheckBox></TD><TD>
<asp:CheckBox id="chkInvestigationsTaskUpd" runat="server" AutoPostBack="True" OnCheckedChanged="chk_CheckedChanged"></asp:CheckBox></TD><TD>
<asp:CheckBox id="chkInvestigationsTaskAcc" runat="server" AutoPostBack="True" OnCheckedChanged="chk_CheckedUnChanged"></asp:CheckBox></TD></TR><TR><TD>
<asp:Label id="lblActivitiesModule" runat="server" Text="Activity Information" CssClass="formlabels"></asp:Label></TD><TD>
<asp:CheckBox id="chkActivitiesAdd" runat="server" AutoPostBack="True" OnCheckedChanged="chk_CheckedChanged"></asp:CheckBox></TD><TD>
<asp:CheckBox id="chkActivitiesDel" runat="server" AutoPostBack="True" OnCheckedChanged="chk_CheckedChanged"></asp:CheckBox></TD><TD>
<asp:CheckBox id="chkActivitiesUpd" runat="server" AutoPostBack="True" OnCheckedChanged="chk_CheckedChanged"></asp:CheckBox></TD><TD>
<asp:CheckBox id="chkActivitiesAcc" runat="server" AutoPostBack="True" OnCheckedChanged="chk_CheckedUnChanged"></asp:CheckBox></TD><TD></TD><TD>
<asp:Label id="lblInvestigationsTodo" runat="server" Text="Investigation To-Do" CssClass="formlabels"></asp:Label></TD><TD>
<asp:CheckBox id="chkInvestigationsTodoAdd" runat="server" AutoPostBack="True" OnCheckedChanged="chk_CheckedChanged"></asp:CheckBox></TD><TD>
<asp:CheckBox id="chkInvestigationsTodoDel" runat="server" AutoPostBack="True" OnCheckedChanged="chk_CheckedChanged"></asp:CheckBox></TD><TD>
<asp:CheckBox id="chkInvestigationsTodoUpd" runat="server" AutoPostBack="True" OnCheckedChanged="chk_CheckedChanged"></asp:CheckBox></TD><TD>
<asp:CheckBox id="chkInvestigationsTodoAcc" runat="server" AutoPostBack="True" OnCheckedChanged="chk_CheckedUnChanged"></asp:CheckBox></TD></TR><TR><TD>
<asp:Label id="lblActivitiesTask" runat="server" Text="Activity Task" CssClass="formlabels"></asp:Label></TD><TD>
<asp:CheckBox id="chkActivitiesTaskAdd" runat="server" AutoPostBack="True" OnCheckedChanged="chk_CheckedChanged"></asp:CheckBox></TD><TD>
<asp:CheckBox id="chkActivitiesTaskDel" runat="server" AutoPostBack="True" OnCheckedChanged="chk_CheckedChanged"></asp:CheckBox></TD><TD>
<asp:CheckBox id="chkActivitiesTaskUpd" runat="server" AutoPostBack="True" OnCheckedChanged="chk_CheckedChanged"></asp:CheckBox></TD><TD>
<asp:CheckBox id="chkActivitiesTaskAcc" runat="server" AutoPostBack="True" OnCheckedChanged="chk_CheckedUnChanged"></asp:CheckBox></TD><TD></TD><TD>
<asp:Label id="lblClosing" runat="server" Text="To-Do Closing" CssClass="formlabels"></asp:Label></TD><TD>
<asp:CheckBox id="chkClosingAdd" runat="server" AutoPostBack="True" OnCheckedChanged="chk_CheckedChanged"></asp:CheckBox></TD><TD>
<asp:CheckBox id="chkClosingDel" runat="server" AutoPostBack="True" OnCheckedChanged="chk_CheckedChanged"></asp:CheckBox></TD><TD>
<asp:CheckBox id="chkClosingUpd" runat="server" AutoPostBack="True" OnCheckedChanged="chk_CheckedChanged"></asp:CheckBox></TD><TD>
<asp:CheckBox id="chkClosingAcc" runat="server" AutoPostBack="True" OnCheckedChanged="chk_CheckedUnChanged"></asp:CheckBox></TD></TR><TR><TD>
<asp:Label id="lblActivitiesTodo" runat="server" Text="Activity To-Do" CssClass="formlabels"></asp:Label></TD><TD>
<asp:CheckBox id="chkActivitiesTodoAdd" runat="server" AutoPostBack="True" OnCheckedChanged="chk_CheckedChanged"></asp:CheckBox></TD><TD>
<asp:CheckBox id="chkActivitiesTodoDel" runat="server" AutoPostBack="True" OnCheckedChanged="chk_CheckedChanged"></asp:CheckBox></TD><TD>
<asp:CheckBox id="chkActivitiesTodoUpd" runat="server" AutoPostBack="True" OnCheckedChanged="chk_CheckedChanged"></asp:CheckBox></TD><TD>
<asp:CheckBox id="chkActivitiesTodoAcc" runat="server" AutoPostBack="True" OnCheckedChanged="chk_CheckedUnChanged"></asp:CheckBox></TD><TD></TD><TD>
<asp:Label id="lblMultiple" runat="server" Text="Table Maintenance" CssClass="formlabels"></asp:Label></TD><TD>
<asp:CheckBox id="chkTableMaintAdd" runat="server" AutoPostBack="True" OnCheckedChanged="chk_CheckedChanged"></asp:CheckBox></TD><TD>
<asp:CheckBox id="chkTableMaintDel" runat="server" AutoPostBack="True" OnCheckedChanged="chk_CheckedChanged"></asp:CheckBox></TD><TD>
<asp:CheckBox id="chkTableMaintUpd" runat="server" AutoPostBack="True" OnCheckedChanged="chk_CheckedChanged"></asp:CheckBox></TD><TD>
<asp:CheckBox id="chkTableMaintAcc" runat="server" AutoPostBack="True" OnCheckedChanged="chk_CheckedUnChanged"></asp:CheckBox></TD></TR><TR><TD>
<asp:Label id="lblAuditModule" runat="server" Text="Audit Information" CssClass="formlabels"></asp:Label></TD><TD>
<asp:CheckBox id="chkAuditAdd" runat="server" AutoPostBack="True" OnCheckedChanged="chk_CheckedChanged"></asp:CheckBox></TD><TD>
<asp:CheckBox id="chkAuditDel" runat="server" AutoPostBack="True" OnCheckedChanged="chk_CheckedChanged"></asp:CheckBox></TD><TD>
<asp:CheckBox id="chkAuditUpd" runat="server" AutoPostBack="True" OnCheckedChanged="chk_CheckedChanged"></asp:CheckBox></TD><TD>
<asp:CheckBox id="chkAuditAcc" runat="server" AutoPostBack="True" OnCheckedChanged="chk_CheckedUnChanged"></asp:CheckBox></TD><TD></TD><TD>
<asp:Label id="lblReportsCriteria" runat="server" Text="Reports Criteria" CssClass="formlabels"></asp:Label></TD><TD>
<asp:CheckBox id="chkReportsAdd" runat="server" AutoPostBack="True" OnCheckedChanged="chk_CheckedChanged"></asp:CheckBox></TD><TD>
<asp:CheckBox id="chkReportsDel" runat="server" AutoPostBack="True" OnCheckedChanged="chk_CheckedChanged"></asp:CheckBox></TD><TD>
<asp:CheckBox id="chkReportsUpd" runat="server" AutoPostBack="True" OnCheckedChanged="chk_CheckedChanged"></asp:CheckBox></TD><TD>
<asp:CheckBox id="chkReportsAcc" runat="server" AutoPostBack="True" OnCheckedChanged="chk_CheckedUnChanged"></asp:CheckBox></TD></TR><TR><TD>
<asp:Label id="lblAuditTask" runat="server" Text="Audit Task" CssClass="formlabels"></asp:Label></TD><TD>
<asp:CheckBox id="chkAuditTaskAdd" runat="server" AutoPostBack="True" OnCheckedChanged="chk_CheckedChanged"></asp:CheckBox></TD><TD>
<asp:CheckBox id="chkAuditTaskDel" runat="server" AutoPostBack="True" OnCheckedChanged="chk_CheckedChanged"></asp:CheckBox></TD><TD>
<asp:CheckBox id="chkAuditTaskUpd" runat="server" AutoPostBack="True" OnCheckedChanged="chk_CheckedChanged"></asp:CheckBox></TD><TD>
<asp:CheckBox id="chkAuditTaskAcc" runat="server" AutoPostBack="True" OnCheckedChanged="chk_CheckedUnChanged"></asp:CheckBox></TD><TD></TD><TD></TD><TD></TD><TD></TD><TD></TD><TD></TD></TR><TR><TD>
<asp:Label id="lblAuditTodo" runat="server" Text="Audit To-Do" CssClass="formlabels"></asp:Label></TD><TD>
<asp:CheckBox id="chkAuditTodoAdd" runat="server" AutoPostBack="True" OnCheckedChanged="chk_CheckedChanged"></asp:CheckBox></TD><TD>
<asp:CheckBox id="chkAuditTodoDel" runat="server" AutoPostBack="True" OnCheckedChanged="chk_CheckedChanged"></asp:CheckBox></TD><TD>
<asp:CheckBox id="chkAuditTodoUpd" runat="server" AutoPostBack="True" OnCheckedChanged="chk_CheckedChanged"></asp:CheckBox></TD><TD>
<asp:CheckBox id="chkAuditTodoAcc" runat="server" AutoPostBack="True" OnCheckedChanged="chk_CheckedUnChanged"></asp:CheckBox></TD><TD></TD><TD></TD><TD></TD><TD></TD><TD></TD><TD></TD></TR></TBODY></TABLE></TD></TR></TBODY></TABLE><BR /><DIV style="LEFT: 0px; POSITION: relative; TOP: 0px">
<TABLE style="WIDTH: 100%; TEXT-ALIGN: center" cellPadding=0><TBODY><TR><TD>
<asp:ImageButton id="cmdClear" runat="server" ImageUrl="images/ch_button_clear.png"></asp:ImageButton> 
<asp:ImageButton id="cmdAdd" runat="server" ImageUrl="images/ch_button_add.png"></asp:ImageButton> 
<asp:ImageButton id="cmdEdit" runat="server" ImageUrl="images/ch_button_update.png"></asp:ImageButton> 
<asp:ImageButton id="cmdDelete" runat="server" ImageUrl="images/ch_button_delete.png"></asp:ImageButton> </TD></TR></TBODY></TABLE></DIV><DIV class="filter_band">
<asp:Label id="lblFilter1" runat="server" Text="Search For Employee Records"></asp:Label> </DIV>
<TABLE class="frame" rules=none width="100%" border=0><TBODY><TR><TD style="TEXT-ALIGN: right">
<asp:Button id="cmdSearch" onclick="cmdSearch_Click" runat="server" Text="Search" Width="110px" Height="21px"></asp:Button></TD></TR></TBODY></TABLE>
<asp:Panel id="searchpanelEmp" runat="server" CssClass="searchpanel" visible="False">  
     
<TABLE style="text-align:center "width="600" height="200" border="0" cellpadding="0" cellspacing="0" > 
       <tr> 
         <td style="height:1px; vertical-align:top; width:1px"><img src="images/tlc.gif" width="20" height="16"></td> 
         <td style="height:1px; vertical-align:top; background-image:url('images/tb.gif');;"><img src="images/tb.gif" width="20" height="16"></td> 
         <td style="height:1px; vertical-align:top; width:1px"><img src="images/trc.gif" width="30" height="16"></td> 
       </tr> 
       <tr> 
         <td style="vertical-align:top; width:1px; background-image:url('images/l.gif')"><img src="images/l.gif" width="20" height="10"></td> 
         <td style="background-color:#eeeeee; width:99%; text-align:center; vertical-align:top"> <div style="position:inherit; text-align:right;"> 
             
<asp:ImageButton ID="grdclsbtn" runat="server" ImageUrl="images/close_btn.gif" /> 
           </div> 
           <div style="overflow-y:scroll; height:200px"> 
<asp:GridView id="grdEmployee" runat="server" AutoGenerateColumns="False" 
                OnSelectedIndexChanged="grdEmployee_SelectedIndexChanged" AllowSorting="True" 
                AllowPaging="False" DataSourceID="dsEmployee" BorderStyle="None" DataKeyNames="EmployeeID" PageSize="20"> 
             <Columns> 
            
<asp:CommandField ShowSelectButton="True"></asp:CommandField> 
<asp:BoundField DataField="EmployeeID" HeaderText="EmployeeID" SortExpression="EmployeeID"></asp:BoundField> 
<asp:BoundField DataField="FName" HeaderText="FName" SortExpression="FName"></asp:BoundField> 
<asp:BoundField DataField="MInitial" HeaderText="MInitial" SortExpression="MInitial"></asp:BoundField> 
<asp:BoundField DataField="LName" HeaderText="LName" SortExpression="LName"></asp:BoundField> 
            </Columns> 
             </asp:GridView> 
<asp:SqlDataSource id="dsEmployee" runat="server"><SelectParameters> 
<asp:SessionParameter SessionField="Client" Name="Company" Type="String"></asp:SessionParameter> </SelectParameters> </asp:SqlDataSource> </div></td> 
         <td style="vertical-align:top; width:1px; background-image:url('images/r.gif')"><img src="images/r.gif" width="30" height="10"></td> 
       </tr> 
       <tr> 
         <td style="height:1px; vertical-align:top; width:1px"><img src="images/blc.gif" width="20" height="16"></td> 
         <td style="height:1px; vertical-align:top; background-image:url('images/bb.gif');"><img src="images/bb.gif" width="20" height="16"></td> 
         <td style="height:1px; vertical-align:top; width:1px"><img src="images/brc.gif" width="30" height="16"></td> 
       </tr> 
     </table> 
   </asp:Panel> <cc1:calendarextender id="CalendarExtender1" runat="server" cssclass="MyCalendar" popupbuttonid="Image1" targetcontrolid="calHiredDate"></cc1:calendarextender> <cc1:calendarextender id="CalendarExtender2" runat="server" cssclass="MyCalendar" popupbuttonid="Image2" targetcontrolid="calTermDate"></cc1:calendarextender> </DIV>
</ContentTemplate> </asp:UpdatePanel> </asp:Content>|
                                              
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:
26:
27:
28:
29:
30:
31:
32:
33:
34:
35:
36:
37:
38:
39:
40:
41:
42:
43:
44:
45:
46:
47:
48:
49:
50:
51:
52:
53:
54:
55:
56:
57:
58:
59:
60:
61:
62:
63:
64:
65:
66:
67:
68:
69:
70:
71:
72:
73:
74:
75:
76:
77:
78:
79:
80:
81:
82:
83:
84:
85:
86:
87:
88:
89:
90:
91:
92:
93:
94:
95:
96:
97:
98:
99:
100:
101:
102:
103:
104:
105:
106:
107:
108:
109:
110:
111:
112:
113:
114:
115:
116:
117:
118:
119:
120:
121:
122:
123:
124:
125:
126:
127:
128:
129:
130:
131:
132:
133:
134:
135:
136:
137:
138:
139:
140:
141:
142:
143:
144:
145:
146:
147:
148:
149:
150:
151:
152:
153:
154:
155:
156:
157:
158:
159:
160:
161:
162:
163:
164:
165:
166:
167:
168:
169:
170:
171:
172:
173:
174:
175:
176:
177:
178:
179:
180:
181:
182:
183:
184:
185:
186:
187:
188:
189:
190:
191:
192:
193:
194:
195:
196:
197:
198:
199:
200:
201:
202:
203:
204:
205:
206:
207:
208:
209:
210:
211:
212:
213:
214:
215:
216:
217:
218:
219:
220:
221:
222:
223:
224:
225:
226:
227:
228:
229:
230:
231:
232:
233:
234:
235:
236:

Select allOpen in new window

 

by: TheLearnedOnePosted on 2008-08-28 at 06:42:57ID: 22334644

You have a lot going on there, with naming containers like UpdatePanel and Table.  You might want to use a recursive search:

Imports System.Collections.Generic
 
Partial Public Class Employee
    Inherits System.Web.UI.Page
 
    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
 
        Dim list As New List(Of Control)
 
        Me.FindControls(list, Me.Page.Form, GetType(CheckBox))
    End Sub
 
    Private Sub FindControls(ByVal list As List(Of Control), ByVal parent As Control, ByVal controlType As Type)
 
        For Each subControl As Control In parent.Controls
            Me.FindControls(list, subControl, controlType)
        Next
 
        If parent.GetType() Is controlType Then
            list.Add(parent)
        End If
 
    End Sub
 
End Class

                                              
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
14:
15:
16:
17:
18:
19:
20:
21:
22:
23:
24:
25:

Select allOpen in new window

 

by: CipherISPosted on 2008-09-08 at 10:09:32ID: 22419361

I have been tied up with other aspects of this app.  I will try to incorporate your recommendations later and see if it works.

20120131-EE-VQP-002

3 Ways to Join

30-Day Free Trial

The Experts

98% positive feedback on 31,087 answers since March 2000. angeliii is a Microsoft Most Valuable Professional for his work with MS SQL Server & Develoment.

He has also proven his knowledge of Visual Basic Programming, PHP Scripting and Oracle Databases.

The Experts

97% positive feedback on 10,752 answers since July 2000. lrmoore has more than 18 years experience in the networking industry.

The six-time Mircosoft MVPs specialties include firewalls, virtual private networking, and network management.

Testimonials

"...and excellent source for support... Kind of like having your very own IT dept." Electriciansnet

Testimonials

"I was apprehensive at signing up at first. However... it has already made my life as an IT administrator much easier." JaCrews

Testimonials

"WOW! You guys have great, active, and knowledgeable people on here." moore50

Business Clients

Business Clients

In the Press

"If you’ve got a question... Experts Exchange can supply an answer.”

In the Press

"...an invaluable aid for both IT professionals and those who require tech support."

In the Press

"where IT professionals provide quick answers on just about any topic"

Business Account Plans

Loading Advertisement...