SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Zealot cruncher06's Avatar
    Join Date
    Feb 2009
    Location
    Illinois, USA
    Posts
    125
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Question Drop Down List with Update Panel is not allowing PostBack

    To remove the flicker from the page, I placed my drop down list in an update panel, but now it does not postback.
    Here is the code with the control that I am trying to run a postback with; the id is ddlDepartment:
    Code:
    <%@ Page Language="VB" AutoEventWireup="false" CodeFile="newRequest.aspx.vb" Inherits="newRequest" Theme="forms" StylesheetTheme="forms" %>
    
    
    <!DOCTYPE html>
    
    
    <html lang=en>
    <head runat="server">
        <meta charset="utf-8" />
        <title>New Request</title>
        <!--[if lt IE 9]>
            <script src="http://html5shiv.googlecode.com/svn/trunk/html5.js">
    
    
            </script>
        <![endif]-->
    </head>
    <body class="scroll">
        <form id="frmNewRequest" runat="server">
            <!-- Script Manager Begin -->
            <asp:ScriptManager ID="newRequestScriptManager"
                               runat="server"
                               EnablePartialRendering="true">
            </asp:ScriptManager>
            <!-- Script Manager End -->
            
            <div id="newRequestTitle">
                <p>New Request for Password/UserId</p>&nbsp;
                <p>Change in Computer Accessibility Status Login</p>
    
    
            </div>
    
    
            <!-- New Request Begin -->
            <div id="newRequest">
                
                <!-- Request Type Begin -->
                <asp:Label ID="lblRequestType"
                       runat="server"
                       Text="Request Type">
                </asp:Label>
                <br />
                <asp:DropDownList ID="ddlRequestType" runat="server">
                    <asp:ListItem  Text="--Select One--" Value=""></asp:ListItem>
                    <asp:ListItem Value="N">New Employee</asp:ListItem>
                    <asp:ListItem Value="U">Update Employee</asp:ListItem>
                    <asp:ListItem Value="T">Terminated Employee</asp:ListItem>
                </asp:DropDownList>
                <!-- Request Type End -->
    
    
                <br /><br />
    
    
                <!-- Date Requested Begin -->
                <asp:Label ID="lblRequestDate"
                           runat="server"
                           Text="Date">
                </asp:Label>
                <br />
                <asp:TextBox ID="txtRequestDate"
                             runat="server"
                             Enabled="False">
                </asp:TextBox>
                <!-- Date Requested End -->
                <br /><br />
    
    
                <!-- Requested By Begin -->
                <asp:Label ID="lblRequestedBy"
                           runat="server"
                           Text="Requested By">
                </asp:Label>
                <br />
                <asp:TextBox ID="txtRequestedBy"
                             runat="server"
                             Enabled="false">
                </asp:TextBox>
                <!-- Requested By End -->
    
    
                <br /><br />
    
    
                <!-- Employee Name Begin -->
                <asp:Label ID="lblEmployeeName"
                           runat="server"
                           Text="Employee Name">
                </asp:Label>
                <br />
                <asp:TextBox ID="txtEmployeeName"
                             runat="server"
                             Text="">
                </asp:TextBox>
                <!-- Employee Name End -->
    
    
                <br /><br />
    
    
                <!-- User ID Begin -->
                <asp:Label ID="lblUserId"
                           runat="server"
                           Text="User ID">
                </asp:Label>
                <br />
                <asp:TextBox ID="txtUserId"
                             runat="server"
                             Text="">
                </asp:TextBox>
                <!-- User ID End -->
                <br /> <br />
    
    
                <!-- Job Type Begin -->
                <asp:Label ID="lblJobType"
                           runat="server"
                           Text="Permanent/Temporary">
                </asp:Label>
    
    
                <br />
    
    
                <asp:DropDownList ID="ddlJobType"
                                  runat="server">
                    <asp:ListItem Selected="True" Text="Permanent" Value="P">
                    
                    </asp:ListItem>
                    <asp:ListItem Text="Temporary" Value="T">
                    
                    </asp:ListItem>
                </asp:DropDownList>
                <!-- Job Type End -->
                <br /> <br />
    
    
                <!-- Job Title Begin -->
                <asp:Label ID="lblPosition"
                           runat="server"
                           Text="Position">
                </asp:Label>
                <br />
                <asp:DropDownList ID="ddlPosition"
                                  runat="server" AppendDataBoundItems="true">
                    <asp:ListItem Text="--Select One--"
                                  Value="">
                    </asp:ListItem>
                </asp:DropDownList>
                <br /><br />
                <!-- Job Title End -->
    
    
                <!-- Department Begin -->
                <asp:Label ID="lblDepartment"
                           runat="server"
                           text="Department">
                </asp:Label>
                <br />
    
    
                <asp:UpdatePanel ID="updateDepartment" runat="server" UpdateMode="Conditional">
                    <ContentTemplate>
                        <asp:DropDownList ID="ddlDepartment"
                                  runat="server"
                                  AppendDataBoundItems="true"
                                  AutoPostBack="True">
                                <asp:ListItem Text="--Select One--"
                                              Value="">
                                </asp:ListItem>
                            </asp:DropDownList>
                    </ContentTemplate>
                </asp:UpdatePanel>
                
                <!-- Department End -->
                <br /><br />
    
    
                <!-- Division Begin -->
                <asp:Label ID="lblDivision"
                           runat="server"
                           Text="Division">
                </asp:Label>
                <br />
                
                <asp:DropDownList ID="ddlDivision"
                                  runat="server" 
                                  AppendDataBoundItems="true"
                                  Enabled="False"
                                  AutoPostBack="True">
                    <asp:ListItem Text="--Select One--"
                                  Value="">
                    </asp:ListItem>                  
                </asp:DropDownList>
                <!-- Division End -->
                <br /><br />
                
                <!-- Section Begin -->
                <asp:Label ID="lblSection"
                           runat="server"
                           Text="Section">
                </asp:Label>
                <br />
                <asp:DropDownList ID="ddlSection"
                                  runat="server"
                                  AppendDataBoundItems="true"
                                  Enabled="false"
                                  AutoPostBack="True">
                    <asp:ListItem Text="--Select One--"
                                  Value="">
                    </asp:ListItem>                  
                </asp:DropDownList>
                <!-- Section End -->
                <br /><br />
                
                <!-- PC Name Begin -->
                <asp:Label ID="lblPcName"
                           runat="server"
                           Text="Assigned PC Name(s)">
                </asp:Label>
                <br />
                <asp:TextBox ID="txtPcName"
                             runat="server">
                </asp:TextBox>&nbsp;
                <!-- PC Name End -->
                 
                <asp:Label ID="lblExampleName"
                           runat="server"
                           Text="(Example: CVCMS117)">
                </asp:Label>
    
    
                <br /> <br />
    
    
                <!-- Effective Date Begin -->
                <asp:Label ID="lblEffectiveDate"
                           runat="server"
                           Text="Effective Date">
                </asp:Label>
    
    
                <br />
                <asp:UpdatePanel ID="UpdatePanel1" runat="server">
                    <ContentTemplate>
                        <asp:Calendar ID="calEffectiveDate"
                              runat="server"
                              Caption="Select a date.">
                        </asp:Calendar>
                    </ContentTemplate>
                </asp:UpdatePanel>
                <!-- Effective Date End -->
    
    
                <br /> <br />
    
    
                <!-- Status Begin -->
                <asp:Label ID="lblStatus"
                           runat="server"
                           Text="Status">
                </asp:Label>
                <br />
    
    
                <asp:DropDownList ID="ddlStatus"
                                  runat="server">
                    <asp:ListItem Selected="True" Value="N">New</asp:ListItem>
                </asp:DropDownList>
                <!-- Status End -->
                <br /><br />
    
    
                <!-- Similar To Begin -->
                <asp:Label ID="lblSimilarTo"
                           runat="server"
                           Text="Similar To">
                </asp:Label>
                <br />
                <asp:TextBox ID="txtSimilarTo"
                             runat="server">
                </asp:TextBox>
                <!-- Similar To End -->
                <br /> <br />
    
    
                <!-- Update Reason Begin -->
                <asp:Label ID="lblUpdateReason"
                           runat="server"
                           Text="Update Reason">
                </asp:Label>
                <br />
                <asp:TextBox ID="txtUpdateReason"
                             runat="server"
                             TextMode="MultiLine">
                </asp:TextBox>
                <!-- Update Reason End -->
                <br /><br />
                             
                <!-- Phone Number Begin -->
                <asp:Label ID="lblPhoneNumber"
                           runat="server"
                           Text="Phone Number">
                </asp:Label>
                <br />
                <asp:TextBox ID="txtPhoneNumber"
                             runat="server">
                </asp:TextBox>
                <!-- Phone Number End -->
                <br /><br />
    
    
                <!-- Contact Number Begin -->
                <asp:Label ID="lblContactNumber"
                           runat="server"
                           Text="ContactNumber">
                </asp:Label>
                <br />
                <asp:TextBox ID="txtContactNumber"
                             runat="server">
                </asp:TextBox>
                <!-- Contact Number End -->
                <br /><br />
    
    
                <!-- Contact Person Begin -->
                <asp:Label ID="lblContactPerson"
                           runat="server"
                           Text="Contact Person">
                </asp:Label>
                <br />
                <asp:TextBox ID="txtContactPerson"
                             runat="server">
                </asp:TextBox>
                <!-- Contact Person End -->
                <br /><br />
                
                <asp:Button ID="btnSubmit"
                            runat="server"
                            Text="Submit" />
    
    
                
            </div>
            <!-- New Request End -->
            
            
            
        </form>
    </body>
    </html>
    Chris S.

  2. #2
    SitePoint Wizard webcosmo's Avatar
    Join Date
    Oct 2007
    Location
    Boston, MA
    Posts
    1,433
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    you have put the dropdownlist inside an updatepanel; which means on post back content inside that would get updated not the rest. you may have to put other parts in UpdatePanel to get the postback update changes on the page; there are other ways as well.

  3. #3
    SitePoint Zealot cruncher06's Avatar
    Join Date
    Feb 2009
    Location
    Illinois, USA
    Posts
    125
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    That makes sense. The drop down list I was trying to update was on the client side so the control was unaffected. I put the Update Panel around both drop down lists and my code works now.

    Thanks webcosmo.


Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •