Solved

ASP.NET Panel and ASP.NET Dropdown list

Posted on 2011-03-01
3
422 Views
Last Modified: 2012-05-11
I have a web form that I would like to have 4 asp.net panels. The 1st panel has three dropdown lists that when the selection is made via selected index change one of the other three panels will then populate/open (it will go to that panel). Any thoughts, examples is greatly appricated.
Code:
<body>
 <form id="form2" runat="server"  >
  <table border="0" align="center" cellpadding="0" cellspacing="0" style="width: 815px">
      <tr>
            <td>&nbsp;</td>
      </tr>
</table>
<table border="0" align="center" cellpadding="0" cellspacing="0" style="width: 815px">
      <tr>
            <td><img src="images/logo.gif" alt="" style="height: 46px; width: 238px;" /></td>
      </tr>
    <tr>
        <td class="style3"></td>
    </tr>
    <tr>
            <td width="815" align="center"><img src="images/blue.gif" alt="" width="128" border="0"/><img src="images/home_02.gif" alt="" width="128" height="49" border="0"/><img src="images/orange.gif" alt="" width="128" height="49" border="0"/><img src="images/home_04.gif" alt="" width="128" height="49" border="0"/><img src="images/navy.gif" alt="" width="128" height="49" border="0"/><img src="images/black.gif" alt="" width="124" height="49" border="0"/></td>
      </tr>

</table>
 <table border="0" align="center" cellpadding="0" cellspacing="0" style="width: 815px">
      <tr>
            <td><img src="images/spacer.gif" alt="" width="100" /></td>
      </tr>
</table>
<table border="0" align="center" cellpadding="0" cellspacing="0">
      <tr>
            <td class="style5">Field Pumper Supervisor Interface</td>
      </tr>
    </table>
<table border="0" align="center" cellpadding="0" cellspacing="0" style="width: 815px">
    <tr>
                        <td class="style4"></td>
                  </tr>
                  
                  <tr>
                        <td class="style8">
                                            <asp:MultiView ID="mvPumperSupervisorInterface" runat="server" ActiveViewIndex="0">
                                              <asp:View ID="vPumperSelection" runat="server" >
                                              <table width="100%">
                                               <tr>
                                               <td align="center" class="style8">
                                              <h5 style="font-family: Arial; text-align: left; border-bottom-style: solid; border-bottom-width: thin; border-bottom-color: #0000FF;"">
                                                  Field:</h5><br />
                                                  <asp:Panel ID="pnlPumperSelection" runat="server" Width="740px">
                                                   <h5 style="font-family: Arial; text-align: left;"><asp:Label ID="lblAnethField" Text="Aneth" runat="server" /><br />
                                                   <br />
                                                  <asp:DropDownList ID="vUnitType_vAnethFieldLink" runat="server"
                                                            onselectedindexchanged="vAneth_SelectedIndexChanged" AutoPostBack="True"  >
                                                      <asp:ListItem></asp:ListItem>
                                                      <asp:ListItem>Aneth Unit Water Facility </asp:ListItem>
                                                      <asp:ListItem>Battery 20</asp:ListItem>
                                                      <asp:ListItem>Battery 21</asp:ListItem>
                                                      <asp:ListItem>Battery 26</asp:ListItem>
                                                      <asp:ListItem>Battery 29</asp:ListItem>
                                                       </asp:DropDownList>
                                                 <br />
                                                 <br /></h5>
                                                       <h5 style="font-family: Arial; text-align: left; border-bottom-style: solid; border-bottom-width: thin; border-bottom-color: Black;"></h5>
                                                          <br />
                                                          <h5 style="font-family: Arial; text-align: left;"><asp:Label ID="Label3" Text="McElmoCreek" runat="server" />
                                                          <br />
                                                          <br />
                                                  <asp:DropDownList ID="vUnitType_vMcElmoCreek" runat="server"
                                                                  CommandArgument="vMcElmoCreekField" ComandName="" OnComand=""  >
                                                      <asp:ListItem></asp:ListItem>
                                                      <asp:ListItem>Area 1</asp:ListItem>
                                                      <asp:ListItem>Area 2</asp:ListItem>
                                                      <asp:ListItem>Area 4</asp:ListItem>
                                                      <asp:ListItem>Area 6</asp:ListItem>
                                                      <asp:ListItem>WAG Well</asp:ListItem>
                                                      <asp:ListItem>Water Injection Only</asp:ListItem>
                                                              </asp:DropDownList>
                                                 <br />
                                                 <br /></h5>
                                                      <h5 style="font-family: Arial; text-align: left; border-bottom-style: solid; border-bottom-width: thin; border-bottom-color: Black;"></h5>
                                                      <br />
                                                      <h5 style="font-family: Arial; text-align: left;"><asp:Label ID="Label4" Text="Ratherford" runat="server" />
                                                      <br />
                                                      <br />
                                                  <asp:DropDownList ID="vUnitType_vRatherford" runat="server"
                                                              CommandArgument="vRatherfordField" ComandName="" OnComand=""  >
                                                      <asp:ListItem></asp:ListItem>
                                                      <asp:ListItem>Battery 1</asp:ListItem>
                                                      <asp:ListItem>Battery 2</asp:ListItem>
                                                      <asp:ListItem>Ratherford Water Flood</asp:ListItem>
                                                          </asp:DropDownList>
                                                 <br />
                                                 <br />
                                                 </h5>
                                                 <h5 style="font-family: Arial; text-align: left; border-bottom-style: solid; border-bottom-width: thin; border-bottom-color: Black;"></h5>
                                                      <br />
                                                   </asp:Panel>
                                                   <br />
                                                   </td>
                                                   </tr>
                                                   </table>
                                              </asp:View>
                                              <asp:View ID="vAneth" runat="server" ><h5 style="font-family: Arial; text-align: left; border-bottom-style: solid; border-bottom-width: thin; border-bottom-color: #0000FF;">Aneth Field:</h5>
                                                 <table border="0" align="center" cellpadding="0" cellspacing="0" style="width: 874px">
                  <tr>
                        <td colspan="3" height="94"><img src="images/logo.gif" alt="" border="0" /></td>
                  </tr>
                  <tr align="center">
                        <td colspan="3" height="49"><img src="images/blue.gif" alt="" width="128" height="49" border="0" /><img src="images/about_02.gif" alt="" width="128" height="49" border="0" /><img src="images/navy.gif" alt="" width="127" height="49" border="0" /><img src="images/orange.gif" alt="" width="129" height="49" border="0" /><img src="images/about_05.gif" alt="" width="126" height="49" border="0" /><img src="images/black2.gif" alt="" width="124" height="49" border="0" /></td>
                  </tr>
            <tr>
                        <td height="24" class="style10"></td>
                  </tr>
                  <tr align="center">
               <td class="style7" align="center">Well Test</td>
      </tr>
    <tr>
                        <td height="24" class="style10"></td>
                  </tr>
</table>
<table border="0" align="center" cellpadding="0" cellspacing="0"
    style="width: 875px; height: 576px;">
                  <tr>
                        <td valign="top" id="left_menu" class="style11">
            <div style=" margin:5px; width: 217px;">  
        <div id="AccordionContainer" class="AccordionContainer">
        <div onclick="runAccordion(1);">
        <div class="AccordionTitle" onclick="return false;">
          Aneth  
        </div>
        </div>
        </div>
         <div id="Accordion1Content" class="AccordionContent">
         <div id="div1">
          <asp:Panel ID="Panel1" runat="server" Height="26px" Width="203px" ></asp:Panel>
         <ASP:Literal id="TreeView" EnableViewState="false" runat="server"/> <!-- Aneth Unit Water Inj Facility -->
         <ASP:Literal id="TreeView1" EnableViewState="True" runat="server"  /> <!-- Battery 20 -->
         <asp:HiddenField runat="server" ID="SelectedPathContainer" />
         <asp:Literal ID ="TreeView1A" EnableViewState ="true" runat="server" /><!-- Battery20/Header 20-08 -->
         <asp:Literal ID="TreeView1AB" EnableViewState="true" runat="server" /><!-- Battery20/Header 20-13 -->
         <asp:Literal ID="TreeView1ABC" EnableViewState="true" runat="server" /><!-- Battery20/Header 20-13/ Header 13-14 -->
         <ASP:Literal id="TreeView2" EnableViewState="True" runat="server"  /><!-- Battery21 -->
         <asp:Literal ID="TreeView2A" EnableViewState="true" runat="server" /><!-- Battery 21/ Header 21-14-->
         <asp:Literal ID="TreeView2AB" EnableViewState="true" runat="server" /><!-- Battery 21/ Header 21-15-->
         <asp:Literal ID="TreeView2ABC" EnableViewState="true" runat="server" /><!-- Battery 21/ Header 21-16-->
         <asp:Literal ID="TreeView2ABCD" EnableViewState="true" runat="server" /><!-- Battery 21/ Header 21-22-->
         <asp:Literal ID="TreeView3" EnableViewState="true" runat="server" /><!-- Battery 26 -->
         <asp:Literal ID="TreeView3A" EnableViewState="true" runat="server" /><!-- Battery 26/ Header 26-25 -->
         <asp:Literal ID="TreeView3AB" EnableViewState="true" runat="server" /><!-- Battery 26/ Header 26-35 -->
         <asp:Literal ID="TreeView4" EnableViewState="true" runat ="server" /><!-- Battery 29 -->
         </div>
        </div>
        </td>
    <td valign="top" id="center_content" align="left" class="style9">
             <!--Anneth -->
     <!--// The head of the menus //-->
              <oem:EasyMenu id="EasyMenu1" runat="server" StyleFolder="Styles/WindowsXP" AttachTo="div1" ShowEvent="ContextMenu">
                    <Components>
                          <oem:MenuItem InnerHtml="Properties" ID="item1" UrlTarget="myiframe" Url="http://denver10/Reports$DS/Pages/Report.aspx?ItemPath=%2fPA+Reports%2fLast+Valid+Well+Test"></oem:MenuItem>
                          <oem:MenuItem InnerHtml="Injection" ID="item2"  UrlTarget="_blank" Url="http://denver10/Reports$DS/Pages/Report.aspx?ItemPath=%2fPA+Reports%2fLast+Valid+Well+Test"></oem:MenuItem>
                          <oem:MenuItem InnerHtml="Projection" ID="item3" Url="http://denver10/Reports$DS/Pages/Report.aspx?ItemPath=%2fPA+Reports%2fLast+Valid+Well+Test"></oem:MenuItem>
                          <oem:MenuItem InnerHtml="Help" ID="item4"></oem:MenuItem>
                    </Components>
              </oem:EasyMenu>

<iframe name="myiframe" style="margin-left: 41px; width: 557px; height: 391px;" ></iframe></td>
</tr>
</table>
<table border="0" align="center" cellpadding="0" cellspacing="0" >
      <tr>
            <td>&nbsp;</td>
      </tr>
    <tr>
            <td align="center" class="style12"><strong><span class="style13">Copyright 2010 Resolute Energy Corp</span>.</strong></td>
      </tr>
      <tr>
            <td class="style12">&nbsp;</td>
      </tr>
</table>
                                                 </asp:View>
                                               <asp:View ID="vMcElmoCreek" runat="server">
                                                 <asp:Panel ID="pnlMcElmoCreek" runat="server">
                                                   <h5 style="font-family: Arial; text-align: left; border-bottom-style: solid; border-bottom-width: thin; border-bottom-color: #0000FF;">McElmo Creek:</h5><br />
                                                     <br />
                                                     <table border="0" align="center" cellpadding="0" cellspacing="0" style="width: 874px">
                  <tr>
                        <td colspan="3" height="94"><img src="images/logo.gif" alt="" border="0" /></td>
                  </tr>
                  <tr align="center">
                        <td colspan="3" height="49"><img src="images/blue.gif" alt="" width="128" height="49" border="0" /><img src="images/about_02.gif" alt="" width="128" height="49" border="0" /><img src="images/navy.gif" alt="" width="127" height="49" border="0" /><img src="images/orange.gif" alt="" width="129" height="49" border="0" /><img src="images/about_05.gif" alt="" width="126" height="49" border="0" /><img src="images/black2.gif" alt="" width="124" height="49" border="0" /></td>
                  </tr>
            <tr>
                        <td height="24" class="style10"></td>
                  </tr>
                  <tr align="center">
               <td class="style7" align="center">Well Test</td>
      </tr>
    <tr>
                        <td height="24" class="style10"></td>
                  </tr>
</table>
<table border="0" align="center" cellpadding="0" cellspacing="0"
    style="width: 875px; height: 576px;">
                  <tr>
                        <td valign="top" id="Td2" class="style11">
                                                    <h6 style="font-family: Arial; text-align: left;">
                                                        <div id="Div4" class="AccordionContainer">
        <div onclick="runAccordion(2);">
        <div class="AccordionTitle" onclick="return false;">
   McElmo
        </div>
       </div>
       </div>
       <div id="Accordion2Content" class="AccordionContent">
       <div id="div2">
       <asp:Panel ID="Panel3" runat="server" Height="26px" Width="203px" ></asp:Panel>
      <asp:Literal ID="TreeView5" EnableViewState="false" runat="server"></asp:Literal><!--Area1-->
      <asp:Literal ID="TreeView5A" EnableViewState="false" runat="server"></asp:Literal><!--Area1 /Satelite 02-->
      <asp:Literal ID="TreeView5AB" EnableViewState="false" runat="server"></asp:Literal><!--Area1 / Satelite 03-->
      <asp:Literal ID="TreeView5ABC" EnableViewState="false" runat="server"></asp:Literal><!--Area1 / Satelite 05-->
      <asp:Literal ID="TreeView5ABCD" EnableViewState="false" runat="server"></asp:Literal><!--Area1 / Satelite 06-->
      <asp:Literal ID="TreeView5ABCDE" EnableViewState="false" runat="server"></asp:Literal><!--Area1 / Satelite 12-->
      <asp:Literal ID="TreeView5ABCDEF" EnableViewState="false" runat="server"></asp:Literal><!--Area1 / Satelite 32-->
      <asp:Literal ID="TreeView6" EnableViewState="false" runat="server"></asp:Literal><!--Area2 -->
      <asp:Literal ID="TreeView6A" EnableViewState="false" runat="server"></asp:Literal><!--Area2 / Satelite 33-->
      <asp:Literal ID="TreeView7" EnableViewState="false" runat="server"></asp:Literal><!--Area4 -->
      <asp:Literal ID="TreeView7A" EnableViewState="false" runat="server"></asp:Literal><!--Area4 / Satelite 09 -->
      <asp:Literal ID="TreeView7AB" EnableViewState="false" runat="server"></asp:Literal><!--Area4 / Satelite 09 / Satelite 17-->
      <asp:Literal ID="TreeView8" EnableViewState="false" runat="server"></asp:Literal><!--Area6 -->
      <asp:Literal ID="TreeView8A" EnableViewState="false" runat="server"></asp:Literal><!--Area6 / Satelite 11 -->
      <asp:Literal ID="TreeView8AB" EnableViewState="false" runat="server"></asp:Literal><!--Area6 / Satelite 19 -->
      <asp:Literal ID="TreeView9" EnableViewState="false" runat="server"></asp:Literal><!--WAG Wells-->
      <asp:Literal ID="TreeView10" EnableViewState="false" runat="server"></asp:Literal><!--Water Injection Only -->
       </div>
       </div> <br /><td valign="top" id="Td1" align="left" class="style9">
                <!--Anneth -->
     <!--// The head of the menus //-->

<!-- McElmo Creek -->
 <oem:EasyMenu id="EasyMenu3" runat="server" StyleFolder="Styles" AttachTo="div2" ShowEvent="ContextMenu">
<Components>
                          <oem:MenuItem InnerHtml="Properties" ID="MenuItem5"  UrlTarget="myiframe" Url="http://denver10/Reports$DS/Pages/Report.aspx?ItemPath=%2fPA+Reports%2fLast+Valid+Well+Test"></oem:MenuItem>
                          <oem:MenuItem InnerHtml="Injection" ID="MenuItem6" UrlTarget="_blank" Url="http://denver10/Reports$DS/Pages/Report.aspx?ItemPath=%2fPA+Reports%2fLast+Valid+Well+Test"></oem:MenuItem>
                          <oem:MenuItem InnerHtml="Projection" ID="MenuItem7" Url="http://denver10/Reports$DS/Pages/Report.aspx?ItemPath=%2fPA+Reports%2fLast+Valid+Well+Test"></oem:MenuItem>
                          <oem:MenuItem InnerHtml="Help" ID="MenuItem8"></oem:MenuItem>
                    </Components>
</oem:EasyMenu>
<iframe name="myiframe" style="margin-left: 41px; width: 557px; height: 391px;" ></iframe></td>
</tr>
</table>
<table border="0" align="center" cellpadding="0" cellspacing="0" >
      <tr>
            <td>&nbsp;</td>
      </tr>
    <tr>
            <td align="center" class="style12"><strong><span class="style13">Copyright 2010 Resolute Energy Corp</span>.</strong></td>
      </tr>
      <tr>
            <td class="style12">&nbsp;</td>
      </tr>
</table>  
                                                     </h6>  
                                                 </asp:Panel>
                                                 </asp:View>
                                                 <asp:View ID="vRatherford" runat="server">
                                                 <asp:Panel ID="pnlRatherford" runat="server">
                                                   <h5 style="font-family: Arial; text-align: left; border-bottom-style: solid; border-bottom-width: thin; border-bottom-color: #0000FF;">Ratherford:</h5><br />
                                                     <br />
                                                   
                                                       <h6 style="font-family: Arial; text-align: left;">
                                                       <table border="0" align="center" cellpadding="0" cellspacing="0" style="width: 874px">
                  <tr>
                        <td colspan="3" height="94"><img src="images/logo.gif" alt="" border="0" /></td>
                  </tr>
                  <tr align="center">
                        <td colspan="3" height="49"><img src="images/blue.gif" alt="" width="128" height="49" border="0" /><img src="images/about_02.gif" alt="" width="128" height="49" border="0" /><img src="images/navy.gif" alt="" width="127" height="49" border="0" /><img src="images/orange.gif" alt="" width="129" height="49" border="0" /><img src="images/about_05.gif" alt="" width="126" height="49" border="0" /><img src="images/black2.gif" alt="" width="124" height="49" border="0" /></td>
                  </tr>
            <tr>
                        <td height="24" class="style10"></td>
                  </tr>
                  <tr align="center">
               <td class="style7" align="center">Well Test</td>
      </tr>
    <tr>
                        <td height="24" class="style10"></td>
                  </tr>
</table>
<table border="0" align="center" cellpadding="0" cellspacing="0"
    style="width: 875px; height: 576px;">
                  <tr>
                        <td valign="top" id="Td3" class="style11">
                <div id="div5" class="AccordionContainer">
       <div onclick="runAccordion(4);">
       <div class="AccordionTitle" onclick="return false;">
 Ratherford
       </div>
      </div>
      </div>
      <div id="Accordion4Content" class="AccordionContent">
      <div id="div3">
      <asp:Panel ID="Panel4" runat="server" Height="26px" Width="203px" ></asp:Panel>
      <asp:Literal ID="TreeView11" EnableViewState="false" runat="server"></asp:Literal><!--Battery 1-->
      <asp:Literal ID="TreeView11A" EnableViewState="false" runat="server"></asp:Literal><!--Battery 1/Satelite 03-->
      <asp:Literal ID="TreeView11AB" EnableViewState="false" runat="server"></asp:Literal><!--Battery 1 / Satelite 08-->
      <asp:Literal ID="TreeView11ABC" EnableViewState="false" runat="server"></asp:Literal><!--Battery 1 / Satelite 15-->
      <asp:Literal ID="TreeView11ABCD" EnableViewState="false" runat="server"></asp:Literal><!--Battery 1 / Satelite 17-->
      <asp:Literal ID="TreeView11ABCDE" EnableViewState="false" runat="server"></asp:Literal><!--Battery 1/ Satelite 20-->
      <asp:Literal ID="TreeView11ABCDEF" EnableViewState="false" runat="server"></asp:Literal><!--Battery 1 / Satelite 20/Satelite28-->
      <asp:Literal ID="TreeView11ABCDEFG" EnableViewState="false" runat="server"></asp:Literal><!--Battery 1 / Satelite 21-->
      <asp:Literal ID="TreeView12" EnableViewState="false" runat="server"></asp:Literal><!--Battery 2 -->
      <asp:Literal ID="TreeView12A" EnableViewState="false" runat="server"></asp:Literal><!--Battery 2/ Satelite 18 -->
      <asp:Literal ID="TreeView12AB" EnableViewState="false" runat="server"></asp:Literal><!--Battery 2 / Satelite 18 / Satelite 07-->
      <asp:Literal ID="TreeView12ABC" EnableViewState="false" runat="server"></asp:Literal><!--Battery 2/ Satelite 24-->
      <asp:Literal ID="TreeView13" EnableViewState="false" runat="server"></asp:Literal><!-- Ratherford Water Flood -->
      <asp:Literal ID="TreeView14" EnableViewState="false" runat="server"></asp:Literal><!--Ratherford Injection Facility-->
      </div>
      </div>
      </div>
       </td>
    <td valign="top" id="Td4" align="left" class="style9">
<!--Ratherford -->
<oem:EasyMenu id="EasyMenu5" runat="server" StyleFolder="Styles" AttachTo="div3" ShowEvent="ContextMenu">
<Components>
                          <oem:MenuItem InnerHtml="Properties" ID="item9" Url="http://denver10/Reports$DS/Pages/Report.aspx?ItemPath=%2fPA+Reports%2fLast+Valid+Well+Test" UrlTarget="myiframe"></oem:MenuItem>
                          <oem:MenuItem InnerHtml="Injection" ID="item10" UrlTarget="_blank" Url="http://denver10/Reports$DS/Pages/Report.aspx?ItemPath=%2fPA+Reports%2fLast+Valid+Well+Test"></oem:MenuItem>
                          <oem:MenuItem InnerHtml="Projection" ID="item11" Url="http://denver10/Reports$DS/Pages/Report.aspx?ItemPath=%2fPA+Reports%2fLast+Valid+Well+Test"></oem:MenuItem>
                          <oem:MenuItem InnerHtml="Help" ID="item12"></oem:MenuItem>
                    </Components>
</oem:EasyMenu>
<iframe name="myiframe" style="margin-left: 41px; width: 557px; height: 391px;" ></iframe></td>
</tr>
</table>
<table border="0" align="center" cellpadding="0" cellspacing="0" >
      <tr>
            <td>&nbsp;</td>
      </tr>
    <tr>
            <td align="center" class="style12"><strong><span class="style13">Copyright 2010 Resolute Energy Corp</span>.</strong></td>
      </tr>
      <tr>
            <td class="style12">&nbsp;</td>
      </tr>
</table>
                                                         <br />
                                                     </h6>
                                                     
                                                 </asp:Panel>
                                               
                                                 </asp:View>
                                           </asp:MultiView>
                                           </td>
                                           </tr>
            <tr>
                <td width="740">&nbsp;</td>
            </tr>
            <tr>
                <td align="center" width="733" ><strong>Copyright 2010 Resolute Energy Corp.
                    </strong>
                    </td>
                    </tr>
                    <tr>
                <td width="740">&nbsp;</td>
            </tr>
</table>
</form>
</body>
0
Comment
Question by:newjeep19
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
3 Comments
 
LVL 3

Expert Comment

by:OblivionSY
ID: 35008764
Can you not have a post back event on the drop downs, and when the value is changed, set the right panel to visible?

not entirely sure what you want to achieve, thats  a lot of unformatted code to read :)

So if I assume right, you change DropDown1 in Panel 1, and you want panel 2 to be shown
If you change DropDown2 then show panel 3
and if the last DropDown3 is changed, show panel 4?

Sounds like the code wants to go in the index change event for each drop down?
0
 

Author Comment

by:newjeep19
ID: 35008865
Correct: When the user selects one of the iteams in the drop down list that selection will show the corresponding panel.
I get this error when I have the post back event set to true and the onselectIndexChange = the panel that I want to show.
Compilation Error
Description: An error occurred during the compilation of a resource required to service this request. Please review the following specific error details and modify your source code appropriately.

Compiler Error Message: CS0118: 'WellTestProject.WebForm2.pnlAneth' is a 'field' but is used like a 'method'

Source Error:

 

Line 517:                                                   <h5 style="font-family: Arial; text-align: left;"><asp:Label ID="lblAnethField" Text="Aneth" runat="server" /><br />
Line 518:                                                   <br />
Line 519:                                                  <asp:DropDownList ID="ddlAnethUnit" runat="server" OnSelectedIndexChanged="pnlAneth" AutoPostBack="true"   >
Line 520:                                                      <asp:ListItem></asp:ListItem>
Line 521:                                                      <asp:ListItem>Aneth Unit Water Facility </asp:ListItem>
 

Source File: c:\Users\remerson\documents\visual studio 2010\projects\welltestproject\welltestproject\WebForm2.aspx    Line: 519

0
 
LVL 3

Accepted Solution

by:
OblivionSY earned 500 total points
ID: 35012600
this is not correct at all. The OnSelectedIndexChanged must point to a method in the code behind. Let me show you how to code one of them.
<asp:DropDownList ID="AccountTypeDropDown" runat="server" Enabled="false" OnSelectedIndexChanged="AccountTypeDropDown_OnSelectedIndexChange">
    </asp:DropDownList>

Open in new window


This is my drop down list - you can see there is a selectedIndexChangeMethod.

protected void AccountTypeDropDown_OnSelectedIndexChange(object sender, EventArgs e)
        {
            this.panel1.visible = true;
            this.panel2.visible = false;
            this.panel3.visible = false;
        }

Open in new window


I would make a seperate event for each drop down, and then you know exactly what is happening. It is possible to point them at the same event, but i suspect this may just get confusing.

One event per drop down. In the code behind (copy the structure of the method from above) set the visibility of the panels as I have shown.

Let me know how it goes.
0

Featured Post

Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
C# Windows Form Navigation - Total Beginner 9 96
Need help with another query 10 54
Timeouts during development 3 29
Manage big list of parameter list 8 26
Introduction This article shows how to use the open source plupload control to upload multiple images. The images are resized on the client side before uploading and the upload is done in chunks. Background I had to provide a way for user…
This article aims to explain the working of CircularLogArchiver. This tool was designed to solve the buildup of log file in cases where systems do not support circular logging or where circular logging is not enabled
Nobody understands Phishing better than an anti-spam company. That’s why we are providing Phishing Awareness Training to our customers. According to a report by Verizon, only 3% of targeted users report malicious emails to management. With compan…
How to Install VMware Tools in Red Hat Enterprise Linux 6.4 (RHEL 6.4) Step-by-Step Tutorial

752 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question