Question : Need to know how to access a user control (.ascx) to build a StringBuilder() in another User Control

Here is some data on my compile error ->
so here is some more data on this line that is giving me an error located in register.ascx
 --> For Each dg As DataList In ctlAttendees.grdAttendees.Rows

Error#           'i2Integration.Modules.EventReg.CustomControls.AttendeeList.Protected WithEvents grdAttendees As System.Web.UI.WebControls.DataGrid' is not accessible in this context because it is 'Protected'.      C:\Documents and Settings\Dennis West\Local Settings\Temp\VWDWebCache\cmaanorcalevents.com\DesktopModules\i2Integration - Events\user\Register.ascx      

this is my -> Register.ascx User control
====================================================
<%@ Control Language="vb" Codebehind="Register.ascx.vb" Inherits="i2Integration.Modules.EventReg.Register"
    AutoEventWireup="false" Explicit="true" %>
<%@ Register TagPrefix="events" TagName="EventDetails" Src="../controls/EventDetails.ascx" %>
<%@ Register TagPrefix="events" TagName="AttendeeList" Src="../controls/AttendeeList.ascx" %>

<%@ Import Namespace="System" %>
<%@ Import Namespace="System.Data" %>
<%@ Import Namespace="System.Data.SqlClient" %>
<%@ Import Namespace="System.Configuration" %>
<%@ Import Namespace="System.Collections" %>
<%@ Import Namespace="System.IO" %>
<%@ Import Namespace="System.Text" %>
<%@ Import Namespace="System.Xml" %>
<%@ Import Namespace="System.Web" %>
<%@ Import Namespace="System.Web.Security" %>
<%@ Import Namespace="System.Web.UI" %>
<%@ Import Namespace="System.Web.UI.WebControls" %>
<%@ Import Namespace="System.Web.UI.WebControls.WebParts" %>
<%@ Import Namespace="System.Web.UI.HtmlControls" %>
<%@ Import Namespace="System.Net.Mail" %>
<%@ Import Namespace="System.Web.UI.Control" %>
<%@ Import Namespace="System.Net.Mail" %>

   

    Visible="false" />

   
   

      * If you are registering and today's date is within 3 days of the event date,
    add a $10.00 late fee.

         Please select the appropriate member or non-member late Fee.

            id="tblAddAttendee" runat="server">
       

           

           

           

           

       
       

           

           

           

           

       
           
   
Attendee Name

                First & Last Name:

                Attendee Email:

                Attendee Type and Cost:

                 

               
           

                                    EnableViewState="False" />
           

               
           

                                    CssClass="CommandButton" ValidationGroup="EventRegAttendee" />
           

             
   
   

    Attendees:

   

   
   

            resourcekey="AttendeeLimitReached" Visible="false">l>
    abel>
            EnableViewState="False" Text="Email event notices to registered attendees"
        ValidationGroup="EventRegAttendee" Width="269px"  OnClick="EmailRegAttendeeNotices()" />
   

             
   

   
       
   

   

   
   

   
       
   

   

   
   

   
       
:RadioButtonList ID="radPayMethod" runat="server" AutoPostBack="False" RepeatDirection="Horizontal"
        CssClass="Normal" />
   
   

    abel>
    ox>
            CssClass="SubHead">abel>
    dator ID="valDonation" runat="server" resourcekey="DonationValidator"
        ControlToValidate="txtDonation" ValidationExpression="^\d+(?:\.\d{0,2})?$">sp:RegularExpressionValidator>
   

   


    Text="Cancel" EnableViewState="False" />
    Text="Next" CausesValidation="False" EnableViewState="False" />
   


this is my attendee control:
===============================
<%@ Control Language="vb" Codebehind="AttendeeList.ascx.vb" Inherits="i2Integration.Modules.EventReg.CustomControls.AttendeeList"
    AutoEventWireup="false" Explicit="true" %>
    EnableViewState="False" Visible="False" Text="No attendees found.">

   
    CellPadding="4" CellSpacing="0" AllowPaging="False" AllowSorting="False" AutoGenerateColumns="False"
    ShowHeader="True" ShowFooter="True" HeaderStyle-CssClass="SubHead" ItemStyle-CssClass="Normal"
    FooterStyle-CssClass="SubHead" FooterStyle-HorizontalAlign="Right" >
   
                    Visible="false" ReadOnly="True" />
       
       
                    ReadOnly="True" />
                    DataFormatString="{0:$#,##0.00}" ItemStyle-HorizontalAlign="Right" FooterText="" />
                    Text="[Remove]" />
   

Answer : Need to know how to access a user control (.ascx) to build a StringBuilder() in another User Control

Forgot to add:
replace:
error->    For Each dr As DataRow In ctlAttendees.grdAttendees.Rows
with
For Each dr As DataRow In ctlAttendees.GetGrdAttendees()
.Rows

Note: The VB code for GetGrdAttendees is at follows: (in the attendee control code behind)
Function GetGrdAttendees() As Integer

        Return grdAttendees
End Function
Random Solutions  
 
programming4us programming4us