Error Rendering Control / Object reference not set to an instance of an object

Last post 07-25-2006 9:00 AM by dblock. 1 replies.

Sort Posts:

  • Error Rendering Control / Object reference not set to an instance of an object

    07-22-2006, 4:03 AM
    • Member
      128 point Member
    • bolla1
    • Member since 07-02-2006, 1:51 PM
    • Switzerland
    • Posts 46

    Hello everone,

    I have a MainPage.aspx in it I have a Multiview where I inserted Project.ascx. The Web User Control uses: atlas:autocompleteExtender, CollapsiblePanelextender, popupControlExtender. I get in the Design Mode the Error "Error Rendering Control / Object reference not set to an instance of an object"(On DesignMode of Project.ascx) and when I execute the page I get an Error "RuntimeError in JScript: Object required" (The Project.ascx works but this Error happens, when I run another Web User Control with a simple update panel, Textbox and Button).

    Is there a god way to debug this kind of errors? (I've already tried Fiddler)

     

    I haven't been able to track down this Error.

    Would appriciate any kind of Help very much!

    -> When I comment out panel5 I don't get the second error

    Project.ascx

    <%@ Control Language="C#" AutoEventWireup="true" CodeFile="Project.ascx.cs" Inherits="WebSites_Project" %>
    <%@ Register Assembly="AtlasControlToolkit" Namespace="AtlasControlToolkit" TagPrefix="atlasToolkit" %>
    <div id="GUIBackground">
        <asp:DropDownList ID="DropDownList1" runat="server" Style="position: static">
            <asp:ListItem>Bolliger</asp:ListItem>
            <asp:ListItem>Zingrich</asp:ListItem>
        </asp:DropDownList>
        &nbsp;&nbsp;
        <asp:DropDownList ID="DropDownList2" runat="server" Style="position: static">
            <asp:ListItem>123456</asp:ListItem>
            <asp:ListItem>345567</asp:ListItem>
            <asp:ListItem>56722</asp:ListItem>
        </asp:DropDownList>
        &nbsp; &nbsp;&nbsp;
        <asp:DropDownList ID="DropDownList3" runat="server" Style="position: static">
            <asp:ListItem>Balisometer II</asp:ListItem>
            <asp:ListItem>QuisRate</asp:ListItem>
            <asp:ListItem>No Project</asp:ListItem>
        </asp:DropDownList><br />
        <br />
        <atlas:AutoCompleteExtender ID="au1" runat="server">
            <atlas:AutoCompleteProperties Enabled="true" MinimumPrefixLength="1" ServiceMethod="GetCaliberName"
                ServicePath="~/SearchAutoComplete.asmx" TargetControlID="TextBoxCaliberName" />
        </atlas:AutoCompleteExtender>
        <asp:Panel ID="Panel1" runat="server" CssClass="collapsePanelHeader" Height="30px">
            <div style="padding: 5px; cursor: pointer; vertical-align: middle;">
                <div style="float: left;">
                    Project&nbsp</div>
                <div style="float: left; margin-left: 20px;">
                    <asp:Label ID="Label1" runat="server">(Show Details...)</asp:Label></div>
                <div style="float: right; vertical-align: middle;">
                    <asp:Image ID="Image1" runat="server" ImageUrl="images/expand_blue.jpg" /></div>
            </div>
        </asp:Panel>
        <atlasToolkit:CollapsiblePanelExtender ID="cpe1" runat="server">
            <atlasToolkit:CollapsiblePanelProperties TargetControlID="PanelProject" ExpandControlID="Panel1"
                CollapseControlID="Panel1" Collapsed="True" TextLabelID="Label1" ExpandedText="(Hide Details...)"
                CollapsedText="(Show Details...)" ImageControlID="Image1" ExpandedImage="images/collapse_blue.jpg"
                CollapsedImage="images/expand_blue.jpg" SuppressPostBack="true" />
            <atlasToolkit:CollapsiblePanelProperties TargetControlID="PanelTask" ExpandControlID="Panel2"
                CollapseControlID="Panel2" Collapsed="True" TextLabelID="Label2" ExpandedText="(Hide Details...)"
                CollapsedText="(Show Details...)" ImageControlID="Image2" ExpandedImage="images/collapse_blue.jpg"
                CollapsedImage="images/expand_blue.jpg" SuppressPostBack="true" />
            <atlasToolkit:CollapsiblePanelProperties TargetControlID="PanelRemark" ExpandControlID="Panel3"
                CollapseControlID="Panel3" Collapsed="True" TextLabelID="Label3" ExpandedText="(Hide Details...)"
                CollapsedText="(Show Details...)" ImageControlID="Image3" ExpandedImage="images/collapse_blue.jpg"
                CollapsedImage="images/expand_blue.jpg" SuppressPostBack="true" />
        </atlasToolkit:CollapsiblePanelExtender>
        <asp:Panel ID="PanelProject" runat="server">
            <fieldset style="width: 912px; height: 350px;">
                <atlas:UpdatePanel ID="UpdatePanel1" runat="server" Mode="Conditional">
                    <ContentTemplate>
                        <table style="width: 963px; position: static; border-top-style: none; border-right-style: none;
                            border-left-style: none; border-bottom-style: none;">
                            <tr>
                                <td style="width: 237px" valign="top">
                                    <asp:Label ID="LabelProjectName" runat="server" Style="position: static" Text="Project Name"></asp:Label></td>
                                <td style="width: 25px" valign="top">
                                    :</td>
                                <td style="width: 116px">
                                    <asp:TextBox ID="TextBoxProjectName" runat="server" Style="position: static" Width="226px"></asp:TextBox></td>
                                <td colspan="3" valign="top">
                                    <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" ErrorMessage="Project is a requiered Field!"
                                        Style="position: static" ControlToValidate="TextBoxProjectName" ValidationGroup="Project"></asp:RequiredFieldValidator>
                                    <asp:RegularExpressionValidator ID="RegularExpressionValidator5" runat="server" ControlToValidate="TextBoxProjectName"
                                        Display="Dynamic" ErrorMessage="Regular Expression of the Type ([a-zA-Z0-9]* ){0,}[a-zA-Z0-9]{1,} requested"
                                        Style="position: static" ValidationExpression="([a-zA-Z0-9]* ){0,}[a-zA-Z0-9]{1,}"
                                        ValidationGroup="Project"></asp:RegularExpressionValidator></td>
                            </tr>
                            <tr>
                                <td style="width: 237px; height: 26px;" valign="top">
                                    <asp:Label ID="LabelCaliberName" runat="server" Style="position: static" Text="Caliber Name"></asp:Label></td>
                                <td style="width: 25px; height: 26px;" valign="top">
                                    :</td>
                                <td style="width: 116px; height: 26px;">
                                    <asp:TextBox ID="TextBoxCaliberName" runat="server" Style="position: static" Width="226px"></asp:TextBox></td>
                                <td colspan="3" valign="top" style="height: 26px">
                                    <asp:RegularExpressionValidator ID="RegularExpressionValidator2" runat="server" ErrorMessage="Regular Expression of the Type [a-zA-Z0-9]* requested"
                                        Style="position: static" Display="Dynamic" ValidationExpression="[a-zA-Z0-9]*"
                                        ValidationGroup="Project" ControlToValidate="TextBoxCaliberName"></asp:RegularExpressionValidator></td>
                            </tr>
                            <tr>
                                <td style="width: 237px" valign="top">
                                    <asp:Label ID="LabelCaliberNumber" runat="server" Style="position: static" Text="Caliber Number"></asp:Label></td>
                                <td style="width: 25px" valign="top">
                                    :</td>
                                <td style="width: 116px">
                                    <asp:TextBox ID="TextBoxCaliberNumber" runat="server" Style="position: static" Width="226px"></asp:TextBox></td>
                                <td colspan="3" valign="top">
                                    <asp:RegularExpressionValidator ID="RegularExpressionValidator3" runat="server" ErrorMessage="Regular Expression of the Type [a-zA-Z0-9]* requested"
                                        Style="position: static" Display="Dynamic" ValidationExpression="[a-zA-Z0-9]*"
                                        ValidationGroup="Project" ControlToValidate="TextBoxCaliberNumber"></asp:RegularExpressionValidator></td>
                            </tr>
                            <tr>
                                <td style="width: 237px" valign="top">
                                    <asp:Label ID="LabelOrderNumber" runat="server" Style="position: static" Text="Order Number"></asp:Label></td>
                                <td style="width: 25px" valign="top">
                                    :</td>
                                <td style="width: 116px">
                                    <asp:TextBox ID="TextBoxOrderNumber" runat="server" Style="position: static" Width="226px"></asp:TextBox></td>
                                <td colspan="3" valign="top">
                                    <asp:RegularExpressionValidator ID="RegularExpressionValidator4" runat="server" ErrorMessage="Regular Expression of the Type [a-zA-Z0-9]* requested"
                                        Style="position: static" Display="Dynamic" ValidationExpression="[a-zA-Z0-9]*"
                                        ValidationGroup="Project" ControlToValidate="TextBoxOrderNumber"></asp:RegularExpressionValidator></td>
                            </tr>
                            <tr>
                                <td style="width: 237px" valign="top">
                                    <asp:Label ID="LabelOrderReceivedDate" runat="server" Style="position: static" Text="Order Received Date"></asp:Label></td>
                                <td style="width: 25px" valign="top">
                                    :</td>
                                <td style="width: 116px">
                                    <asp:TextBox ID="TextBoxOrderReceivedDate" runat="server" Style="position: static"
                                        Width="226px"></asp:TextBox></td>
                                <td colspan="3" valign="top">
                            </tr>
                            <tr>
                                <td style="width: 237px;" valign="top">
                                    <asp:Label ID="LabelOfferSentDate" runat="server" Style="position: static" Text="Offer Sent Date"></asp:Label></td>
                                <td style="width: 25px;" valign="top">
                                    :</td>
                                <td style="width: 116px;">
                                    <asp:TextBox ID="TextBoxOfferSentDate" runat="server" Style="position: static" Width="226px"></asp:TextBox></td>
                                <td colspan="3" valign="top">
                            </tr>
                            <tr>
                                <td style="width: 237px" valign="top">
                                    <asp:Label ID="LabelOfferRequestedDate" runat="server" Style="position: static" Text="Offer Requested Date "></asp:Label></td>
                                <td style="width: 25px" valign="top">
                                    :</td>
                                <td style="width: 116px">
                                    <asp:TextBox ID="TextBoxOfferRequestedDate" runat="server" Style="position: static"
                                        Width="226px"></asp:TextBox></td>
                                <td colspan="3" valign="top">
                            </tr>
                            <tr>
                                <td style="width: 237px" valign="top">
                                    <asp:Label ID="LabelDeliveredDate" runat="server" Style="position: static" Text="Delivered Date"></asp:Label></td>
                                <td style="width: 25px" valign="top">
                                    :</td>
                                <td style="width: 116px">
                                    <asp:TextBox ID="TextBoxDeliveredDate" runat="server" Style="position: static" Width="226px"></asp:TextBox></td>
                                <td colspan="3" valign="top">
                            </tr>
                            <tr>
                                <td style="width: 237px" valign="top">
                                    <asp:Label ID="LabelProjectStartDate" runat="server" Style="position: static" Text="Project Start Date"></asp:Label></td>
                                <td style="width: 25px" valign="top">
                                    :</td>
                                <td style="width: 116px">
                                    <asp:TextBox ID="TextBoxProjectStartDate" runat="server" Style="position: static"
                                        Width="226px"></asp:TextBox></td>
                                <td colspan="3" valign="top">
                            </tr>
                            <tr>
                                <td style="width: 237px;" valign="top">
                                    <asp:Label ID="LabelProjectEndDate" runat="server" Style="position: static" Text="Project End Date"></asp:Label></td>
                                <td style="width: 25px;" valign="top">
                                    :</td>
                                <td style="width: 116px;">
                                    <asp:TextBox ID="TextBoxProjectEndDate" runat="server" Style="position: static" Width="226px"></asp:TextBox></td>
                                <td colspan="3" valign="top">
                            </tr>
                            <tr>
                                <td style="width: 237px" valign="top">
                                    <asp:Label ID="LabelCustomer" runat="server" Style="position: static" Text="Customer"></asp:Label></td>
                                <td style="width: 25px" valign="top">
                                    :</td>
                                <td style="width: 116px">
                                    <asp:DropDownList ID="DropDownListCustomer" runat="server" Style="position: static"
                                        Width="233px">
                                    </asp:DropDownList></td>
                                <td colspan="3" valign="top">
                                    <asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server" ErrorMessage="Customer is a requiered Field!"
                                        Style="position: static" ControlToValidate="DropDownListCustomer" ValidationGroup="Project"></asp:RequiredFieldValidator></td>
                            </tr>
                            <tr>
                                <td style="width: 237px" valign="top">
                                    <asp:Label ID="LabelProjectesponsiblePerson" runat="server" Style="position: static"
                                        Text="Project responsable Person"></asp:Label></td>
                                <td style="width: 25px" valign="top">
                                    :</td>
                                <td style="width: 116px">
                                    <asp:DropDownList ID="DropDownListEmployee" runat="server" Style="position: static"
                                        Width="233px">
                                    </asp:DropDownList></td>
                                <td colspan="3" valign="top">
                                    <asp:RequiredFieldValidator ID="RequiredFieldValidator3" runat="server" ErrorMessage="Project responable Person is a requiered Field!"
                                        Style="position: static" ControlToValidate="DropDownListEmployee" ValidationGroup="Project"></asp:RequiredFieldValidator></td>
                            </tr>
                            <tr>
                                <td style="width: 237px;" valign="top">
                                    <asp:Label ID="LabelDossierLocation" runat="server" Style="position: static" Text="Dossier Location"></asp:Label></td>
                                <td style="width: 25px;" valign="top">
                                    :</td>
                                <td style="width: 116px;">
                                    <asp:DropDownList ID="DropDownListDossierLocation" runat="server" Style="position: static"
                                        Width="233px">
                                    </asp:DropDownList></td>
                                <td colspan="3" valign="top">
                                </td>
                            </tr>
                            <tr>
                                <td style="width: 237px" valign="top">
                                    <asp:Label ID="LabelProjectState" runat="server" Style="position: static" Text="Project State"></asp:Label></td>
                                <td style="width: 25px" valign="top">
                                    :</td>
                                <td style="width: 116px">
                                    <asp:DropDownList ID="DropDownListProjectState" runat="server" Style="position: static"
                                        Width="233px" OnSelectedIndexChanged="DropDownListProjectState_SelectedIndexChanged">
                                    </asp:DropDownList></td>
                                <td colspan="3" valign="top">
                                    <asp:RequiredFieldValidator ID="RequiredFieldValidator4" runat="server" ErrorMessage="Project State is a requiered Field!"
                                        Style="position: static" ControlToValidate="DropDownListProjectState" ValidationGroup="Project"></asp:RequiredFieldValidator></td>
                            </tr>
                            <tr>
                                <td style="width: 237px;" valign="top">
                                    <asp:Label ID="LabelIAVNumber" runat="server" Style="position: static" Text="IAV Number"></asp:Label></td>
                                <td style="width: 25px;" valign="top">
                                    :</td>
                                <td style="width: 116px;">
                                    <asp:TextBox ID="TextBoxIAVNumber" runat="server" Style="position: static" Width="226px"></asp:TextBox></td>
                                <td colspan="3" valign="top">
                                    <asp:RegularExpressionValidator ID="RegularExpressionValidator1" runat="server" ErrorMessage="Regular Expression of the Type [0-9]{6}requested"
                                        Style="position: static" Display="Dynamic" ValidationExpression="[0-9]{6}" ValidationGroup="Project"
                                        ControlToValidate="TextBoxIAVNumber"></asp:RegularExpressionValidator></td>
                            </tr>
                            <tr>
                                <td style="width: 237px;" valign="top">
                                    <asp:Label ID="LabelProjectDescription" runat="server" Style="position: static" Text="Project Description"
                                        EnableTheming="False"></asp:Label></td>
                                <td style="width: 25px;" valign="top">
                                    :</td>
                                <td style="width: 116px;">
                                    <asp:TextBox ID="TextBoxProjectDescription" runat="server" Style="position: static"
                                        TextMode="MultiLine" Width="226px"></asp:TextBox></td>
                                <td colspan="3" valign="top">
                                    <asp:RequiredFieldValidator ID="RequiredFieldValidator5" runat="server" ErrorMessage="Project Description is a requiered Field!"
                                        Style="position: static" ControlToValidate="TextBoxProjectDescription" ValidationGroup="Project"></asp:RequiredFieldValidator></td>
                            </tr>
                            <tr>
                                <td style="width: 237px" valign="top">
                                </td>
                                <td style="width: 25px" valign="top">
                                </td>
                                <td style="width: 116px">
                                </td>
                                <td colspan="3" valign="top">
                                </td>
                            </tr>
                            <tr>
                                <td style="width: 237px" valign="top">
                                    <asp:Button ID="ButtonModifyProject" runat="server" Style="position: static" Text="Modify Project"
                                        Width="200px" OnClick="ButtonModifyProject_Click" ValidationGroup="Project" /></td>
                                <td style="width: 25px" valign="top">
                                </td>
                                <td style="width: 116px">
                                    <asp:Button ID="ButtonNewProject" runat="server" Style="position: static" Text="Create New Project"
                                        Width="200px" OnClick="ButtonNewProject_Click" ValidationGroup="Project" /></td>
                                <td colspan="3" valign="top">
                                    <asp:Button ID="Button1" runat="server" OnClick="Button1_Click" Style="position: static"
                                        Text="Button" />
                                    <asp:TextBox ID="TextBox1" runat="server" Style="position: static"></asp:TextBox></td>
                            </tr>
                            <tr>
                                <td style="width: 237px" valign="top">
                                    <asp:Button ID="ButtonClearAllProjectFields" runat="server" Style="position: static"
                                        Text="Clear All Project Fields" Width="200px" OnClick="ButtonClearAllProjectFields_Click"
                                        ValidationGroup="Project" /></td>
                                <td style="width: 25px" valign="top">
                                </td>
                                <td style="width: 116px">
                                    <asp:Button ID="ButtonRemoveProject" runat="server" Style="position: static" Text="Remove Project"
                                        Width="200px" OnClick="ButtonRemoveProject_Click" ValidationGroup="Project" /></td>
                                <td colspan="3" valign="top">
                                </td>
                            </tr>
                        </table>
                    </ContentTemplate>
                    <Triggers>
                        <atlas:ControlEventTrigger ControlID="ButtonModifyProject" EventName="Click" />
                        <atlas:ControlEventTrigger ControlID="ButtonNewProject" EventName="Click" />
                        <atlas:ControlEventTrigger ControlID="ButtonClearAllProjectFields" EventName="Click" />
                        <atlas:ControlEventTrigger ControlID="ButtonRemoveProject" EventName="Click" />
                    </Triggers>
                </atlas:UpdatePanel>
            </fieldset>
            &nbsp;&nbsp;
        </asp:Panel>
        <asp:Panel ID="Panel2" runat="server" CssClass="collapsePanelHeader" Height="30px">
            <div style="padding: 5px; cursor: pointer; vertical-align: middle;">
                <div style="float: left;">
                    Task&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp</div>
                <div style="float: left; margin-left: 20px;">
                    <asp:Label ID="Label2" runat="server">(Show Details...)</asp:Label></div>
                <div style="float: right; vertical-align: middle;">
                    <asp:Image ID="Image2" runat="server" ImageUrl="images/expand_blue.jpg" /></div>
            </div>
        </asp:Panel>
        <asp:Panel ID="PanelTask" runat="server">
            <fieldset style="width: 912px; height: 350px;">
                dfgdgdg dgdgdfg dgdgfd
            </fieldset>
            &nbsp;&nbsp;
        </asp:Panel>
        <asp:Panel ID="Panel3" runat="server" CssClass="collapsePanelHeader" Height="30px">
            <div style="padding: 5px; cursor: pointer; vertical-align: middle;">
                <div style="float: left;">
                    Remark</div>
                <div style="float: left; margin-left: 20px;">
                    <asp:Label ID="Label3" runat="server">(Show Details...)</asp:Label></div>
                <div style="float: right; vertical-align: middle;">
                    <asp:Image ID="Image3" runat="server" ImageUrl="images/expand_blue.jpg" /></div>
            </div>
        </asp:Panel>
        <asp:Panel ID="PanelRemark" runat="server">
            <fieldset style="width: 912px; height: 350px;">
                dfgdgdg dgdgdfg dgdgfd
            </fieldset>
            &nbsp;&nbsp;
        </asp:Panel>
    </div>
    <asp:Panel ID="panel5" runat="server" CssClass="popupControl">
        <atlas:UpdatePanel ID="UpdatePanel2" runat="server">
            <ContentTemplate>
              <atlasToolkit:PopupControlExtender ID="PopupControlExtender1" runat="server">
                    <atlasToolkit:PopupControlProperties TargetControlID="TextBoxOrderReceivedDate" PopupControlID="panel5"
                        Position="Bottom" />
                    <atlasToolkit:PopupControlProperties TargetControlID="TextBoxOfferSentDate" PopupControlID="panel5"
                        Position="Bottom" />
                    <atlasToolkit:PopupControlProperties TargetControlID="TextBoxOfferRequestedDate"
                        PopupControlID="panel5" Position="Bottom" />
                    <atlasToolkit:PopupControlProperties TargetControlID="TextBoxDeliveredDate" PopupControlID="panel5"
                        Position="Bottom" />
                    <atlasToolkit:PopupControlProperties TargetControlID="TextBoxProjectStartDate" PopupControlID="panel5"
                        Position="Bottom" />
                    <atlasToolkit:PopupControlProperties TargetControlID="TextBoxProjectEndDate" PopupControlID="panel5"
                        Position="Bottom" />
                </atlasToolkit:PopupControlExtender>
                &nbsp;
                <asp:Calendar ID="Calendar1" runat="server" BackColor="White" BorderColor="#999999"
                    CellPadding="1" DayNameFormat="Shortest" Font-Names="Verdana" Font-Size="8pt"
                    ForeColor="Black" Width="160px" OnSelectionChanged="Calendar1_SelectionChanged">
                    <SelectedDayStyle BackColor="#666666" Font-Bold="True" ForeColor="White" />
                    <TodayDayStyle BackColor="#CCCCCC" ForeColor="Black" />
                    <SelectorStyle BackColor="#CCCCCC" />
                    <WeekendDayStyle BackColor="#FFFFCC" />
                    <OtherMonthDayStyle ForeColor="#808080" />
                    <NextPrevStyle VerticalAlign="Bottom" />
                    <DayHeaderStyle BackColor="#CCCCCC" Font-Bold="True" Font-Size="7pt" />
                    <TitleStyle BackColor="#999999" BorderColor="Black" Font-Bold="True" />
                </asp:Calendar> 
            </ContentTemplate>
        </atlas:UpdatePanel>
    </asp:Panel>


    _____________________________________________________

    Code Behinde:

    protected void Calendar1_SelectionChanged(object sender, EventArgs e)
        {
            //PopupControlExtender1.Commit(Calendar1.SelectedDate.ToString("yyyy-MM-dd"));
            PopupControlExtender1.Commit(Calendar1.SelectedDate.ToLongDateString());
        }

  • Re: Error Rendering Control / Object reference not set to an instance of an object

    07-25-2006, 9:00 AM
    • Member
      365 point Member
    • dblock
    • Member since 12-06-2005, 12:33 PM
    • New York
    • Posts 95

    Typically happens when something is Visible = false on the first page load and then you try to do something with it in a postback inside an update panel. That just can't work.

    Usually under a debugger you're going to see that exception.

    dB. - www.dblock.org / www.foodcandy.com
Page 1 of 1 (2 items)