troubleshooting Question

ASP.net - How to access controls in VB.net code behind

Avatar of GIANTOCR
GIANTOCR asked on
ASP.NETVisual Basic.NET
5 Comments3 Solutions737 ViewsLast Modified:
I am working on an ASP.net project in VS 2008, using Visual Basic. This project was started by someone else.

I have added some new controls to an existing UpdatePanel. I am unable to access the new controls in the visual basic code behind. When I type in the controls' names I would expect Intellisense to recognize the control and allow me to access its methods, properties and whatnot.

Strange thing is that the existing controls that were in the Update Panel before I started modifying it are accessible through Intellisense in visual basic.

I can not find where the settings for the existing controls are any different from the new controls.

<asp:UpdatePanel ID="SeriesUpdatePanel" runat="server" 
        UpdateMode="Conditional" ChildrenAsTriggers="False" >
    <Triggers>
    <asp:AsyncPostBackTrigger ControlID="ButtonIndexChanged" EventName="Click" />
    <asp:AsyncPostBackTrigger ControlID="RemoveSeriesButton" EventName="Click" />
    <asp:PostBackTrigger ControlID="SeriesEditOK" />
    </Triggers>
    <ContentTemplate>
        <asp:Panel ID="seriespopuppanel" runat="server" class="seriespopuppanel" 
        Height="339px" Width="281px">
        <table>
                    </tr>
                        <tr>
   
                <td class="style2" colspan="3" style="width:80%;">
                    <table style="width:100%;border:solid"><tr><th>Edit Data Series</th></tr></table></td>

            </tr>
            <tr>
                <td class="style1">
                    <asp:ListBox ID="SeriesListBox" rowspan="3" runat="server" onchange="IndexChanged()"></asp:ListBox>
                </td>
                <td class="style2">
                    &nbsp;</td>
                <td>
                    &nbsp;</td>
            </tr>
            <tr>
                <td class="style1">
                    </td>
                <td class="style2">
                    Visible</td>
                <td>
                    <input ID="VisibleCheckbox" type="checkbox" runat="server"/></td>
            </tr>
            <tr>
                <td class="style1">
                    &nbsp;</td>
                <td class="style2">
                    Show Limits</td>
                <td>
                    <input ID="ShowLimitsCheckbox" type="checkbox" runat="server" /></td>
            </tr>
                        <tr>
                <td class="style1">
                    <asp:Button ID="SeriesEditOK" Text="OK" Width="60px" runat="server" onclientclick="UpdateSeriesProperties()"/>
                            </td>
                <td class="style2">
                    Show Marker</td>
                <td>
                    <input ID="ShowMarkerCheckbox" type="checkbox" runat="server" /></td>
            </tr>
                        <tr>
                <td class="style1">
                    &nbsp;</td>
                <td class="style2">
                    Y Axis</td>
                <td>
                    <select ID="YAxisSelect" name="D2" runat="server">
                        <option>1</option>
                        <option>2</option>
                    </select></td>
            </tr>
            <tr>
                <td class="style1">
                    &nbsp;</td>
                <td class="style2">
                    Autoscale</td>
                <td>
                    <input ID="AutoScaleCheckbox" type="checkbox" runat="server" /></td>
            </tr>
            <tr>
                <td class="style1">
                    &nbsp;</td>
                <td class="style2">
                    Y Axis Min</td>
                <td>
                    <asp:TextBox ID="AxisMinTextBox" runat="server"></asp:TextBox>
                </td>
            </tr>
                        <tr>
                <td class="style1">
                    &nbsp;</td>
                <td class="style2">
                    Y Axis Max</td>
                <td>
                    <asp:TextBox ID="AxisMaxTextBox" runat="server"></asp:TextBox>
                            </td>
            </tr>
                        <tr>
                <td class="style1">
                    <asp:Button ID="SeriesEditCancel" runat="server" Text="Cancel" Width="60px" />
                            </td>
                <td class="style2">
                    <asp:Button ID="RemoveSeriesButton" runat="server" Text="Remove" />
                            </td>
                <td>
                    <asp:Button id="ButtonIndexChanged" Text="Index Changed" style="display: none;" OnClick="SeriesListBox_SelectedIndexChanged" runat="server" />
                    </td>
            </tr>
                        </tr>
                        <tr>
                <td class="style1">
                    &nbsp;</td>
                <td class="style2">
                    &nbsp;</td>
                <td>
                    &nbsp;</td>
            </tr>
        </table>
    </asp:Panel>
    </ContentTemplate>
    </asp:UpdatePanel>

In the code above, all the controls are accessible with the exception of "AutoScaleCheckbox", "AxisMinTextBox" and "AxisMaxTextBox".

When I type in these control names in visual basic I get the following error:

Name '' is not declared.

I would appreciate any help you can provide.

Thanks
ASKER CERTIFIED SOLUTION
Join our community to see this answer!
Unlock 3 Answers and 5 Comments.
Start Free Trial
Learn from the best

Network and collaborate with thousands of CTOs, CISOs, and IT Pros rooting for you and your success.

Andrew Hancock - VMware vExpert
See if this solution works for you by signing up for a 7 day free trial.
Unlock 3 Answers and 5 Comments.
Try for 7 days

”The time we save is the biggest benefit of E-E to our team. 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