Advertisement

06.18.2008 at 09:28PM PDT, ID: 23497727
[x]
Attachment Details
[x]
The Solution Rating System

With so many solutions, how can you tell which solutions are most likely to help you and which ones are not? To provide you with a tool to use, we rate our solutions based on various elements that most accurately determine if a solution is a quality solution. To explain what factors affect the solution rating, here are the elements we take into consideration when formulating our solution rating.

  • The Grade of the Solution
  • The Zone Rank of the Expert Providing the Solution
  • The Number of Author and Expert Comments
  • The Number of Experts Contributing
  • The Feedback of the Community

Your Input Matters
Because of the way the system is set up, the most important variable in this equation is you. As a member of Experts Exchange, you are able to cast your vote on the quality of the solutions in regard to how complete, accurate, helpful and easy to understand each solution is. When you provide your feedback, each rating is adjusted accordingly. So, if you see a solution that has a poor rating that you think is a good solution, let us know by rating it. As you do, the rating will be adjusted and will become more accurate for other members of our site.

If you have any suggestions that you would like to make for our rating system, please ask a question in the Suggestions Zone of Community Support.

Thank you!

8.8

Issues using a web usercontrol dynamically

Asked by jvancojr in Programming for ASP.NET, Microsoft Visual Basic.Net, .NET Framework 2.x

Tags: ,

G Evening,
I have build multiple web usercontrols that work perfect is dragged and dropped on a web form but i can not get to work if loaded dynamically. When i dynamically load the control and set the custom properties, which are stored in a label control, I get a 'NullReferenceException was unhandled by user control'.
Setting ID (standard control proprty) loads without error, it is just the ones that call controls in the controlStart Free Trial
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:
//Properties region of one of the Custom Web usercontrol BirthdayList.ascx
#Region "Properties"
 
    Public Property NewsletterMonth() As Integer
        Get
            Try
                Return CInt(Me.lblNewletterMonth.Text)
            Catch ex As Exception
                Return Now.Month
            End Try
 
        End Get
        Set(ByVal value As Integer)
            Me.lblNewletterMonth.Text = value.ToString
        End Set
    End Property
 
    Public Property NewsletterYear() As Integer
        Get
            Try
                Dim TheYear As Integer = CInt(Me.lblNewsletterYear.Text)
                If TheYear = 0 Then
                    Return Now.Year
                Else
                    Return TheYear
                End If
 
            Catch ex As Exception
                Return Now.Year
            End Try
        End Get
        Set(ByVal value As Integer)
            Me.lblNewsletterYear.Text = value.ToString
        End Set
    End Property
    Private Property EventID() As Integer
        Get
            Try
                Return Convert.ToInt16(lblEventID.Text)
            Catch ex As Exception
                Return 0
            End Try
 
        End Get
        Set(ByVal value As Integer)
            lblEventID.Text = value.ToString
        End Set
    End Property
    Public Property CN() As String
        Get
            Return Me.lblCN.Text
        End Get
        Set(ByVal value As String)
            Me.lblCN.Text = value
        End Set
    End Property
#End Region
 
//Code that loads the custom control
 Dim moduleToAdd As New usercontrols_BirthdayList
                With moduleToAdd
                    .ID = selectedLocation.ToString & counttolCount.ToString
                    .CN = cn
                    .NewsletterMonth = NewsLetterMonth
                    .NewsletterYear = NewsLetterYear
 
                End With
 
Loading Advertisement...
 
[+][-]06.19.2008 at 12:01AM PDT, ID: 21819793

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]06.19.2008 at 12:22AM PDT, ID: 21819927

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]06.19.2008 at 05:58AM PDT, ID: 21821659

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]06.19.2008 at 09:02AM PDT, ID: 21823576

At Experts Exchange, members can ask their questions to thousands of technology professionals, also known as Experts. Experts compete and collaborate to answer those questions by leaving comments like this one.

Start your 7-day free trial to view this Expert Comment or ask the Experts your question.

 
[+][-]06.29.2008 at 05:11PM PDT, ID: 21896010

Often, when Experts are collaborating with members who have asked questions, they will request additional information about the problem. Askers respond with an author comment like this one.

Start your 7-day free trial to view this Author Comment or ask the Experts your question.

 
[+][-]06.29.2008 at 11:36PM PDT, ID: 21897058

View this solution now by starting your 7-day free trial. Setting up your free trial is quick, easy, and secure. We will return you to this solution, unlocked, when you're done.

 

About this solution

Zones: Programming for ASP.NET, Microsoft Visual Basic.Net, .NET Framework 2.x
Tags: VB.NET, IE 7
Sign Up Now!
Solution Provided By: ororiole
Participating Experts: 3
Solution Grade: A
 
 
[+][-]09.25.2008 at 04:59AM PDT, ID: 22568114

Experts Exchange has a courteous staff of administrators who help members get the most out of the website by means of administrative comments like this one.

Start your 7-day free trial to view this Administrative Comment or ask the Experts your question.

 
[+][-]09.29.2008 at 02:57PM PDT, ID: 22601149

Experts Exchange has a courteous staff of administrators who help members get the most out of the website by means of administrative comments like this one.

Start your 7-day free trial to view this Administrative Comment or ask the Experts your question.

 
 
Loading Advertisement...
20080716-EE-VQP-32 / EE_QW_2_20070628