Click here to Skip to main content
15,898,374 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
i have a update panel and a update progress on my page ...
and my update panel contain some dropdown lists and some button ..
i when i use dropdown lists . .. than autopost back occours and update progress works all time .
but i don't want to do .. i want that my update progress work only when i submitting data using "Submit" button (that has button id="button1")

my aspx code is as given ...
ASP.NET
<asp:UpdatePanel ID="upddd" runat="server">
  <contenttemplate>
      <asp:Panel ID="Panel1" runat="server" Width="100%">
          <asp:UpdateProgress ID="UpdateProgress1" runat="server" AssociatedUpdatePanelID="upddd" DisplayAfter="1">
          <progresstemplate>
          
                  
        <h1> Page is Processing ...  </h1>
        
            </progresstemplate>
          
    <table class="style8">
        <tr>
            <td bgcolor="#AA3F3C" style="font-weight: bold; color: #FFFFFF">
                PROPOSAL INFORMATION </td>
        </tr>
        <tr>
            <td>
                <table class="style8">
                    <tr>
                        <td align="right">
                            Loan Proposal Type:-  </td>
                                                        <td align="left">
                                                            <asp:DropDownList ID="DropDownList8" runat="server" CssClass="smalldropdown" 
                                                                onselectedindexchanged="DropDownList8_SelectedIndexChanged">
                                                                <asp:ListItem>Select
                                                                <asp:ListItem>1-For Fresh Clients(Proposal)
                                                                <asp:ListItem>2-For Existing Clients(Proposal)
                                                            
                                                            <asp:RequiredFieldValidator ID="RequiredFieldValidator9" runat="server" 
                                                                ControlToValidate="DropDownList8" ErrorMessage="Please Select Proposal Type" 
                                                                InitialValue="Select" SetFocusOnError="True">
                                                        </td>
                                                    </tr>
                    <tr>
                        <td align="right" class="style1">
                            Branch/Unit Name:-</td>
                                                        <td align="left" class="style1">
                                                            <asp:DropDownList ID="DropDownList1" runat="server" AutoPostBack="True" 
                                                                CssClass="smalldropdown" Height="17px" 
                                                                onselectedindexchanged="DropDownList1_SelectedIndexChanged">
                                                                <asp:ListItem>Select
                                                            
                                                            <asp:RequiredFieldValidator ID="RequiredFieldValidator1" runat="server" 
                                                                ControlToValidate="DropDownList1" ErrorMessage="Please select Branch/Unit" 
                                                                InitialValue="Select" SetFocusOnError="True">
                                                        </td>
                                                    </tr>
                                                    <tr>
                                                        <td align="right">
                                                            Center Name:-</td>
                                                        <td align="left">
                                                            <asp:DropDownList ID="DropDownList2" runat="server" AutoPostBack="True" 
                                                                CssClass="smalldropdown" 
                                                                onselectedindexchanged="DropDownList2_SelectedIndexChanged">
                                                                <asp:ListItem>Select
                                                            
                                                            <asp:RequiredFieldValidator ID="RequiredFieldValidator2" runat="server" 
                                                                ControlToValidate="DropDownList2" ErrorMessage="Please select center" 
                                                                InitialValue="Select" SetFocusOnError="True">
                                                        </td>
                                                    </tr>
                                                    <tr>
                                                        <td align="right">
                            Client Name:- 
                        </td>
                        <td align="left">
                            <asp:DropDownList ID="DropDownList3" runat="server" CssClass="smalldropdown">
                                <asp:ListItem>Select
                            
                            <asp:RequiredFieldValidator ID="RequiredFieldValidator3" runat="server" 
                                ControlToValidate="DropDownList3" ErrorMessage="Please select client" 
                                InitialValue="Select">
                        </td>
                    </tr>
                    <tr>
                        <td align="right">
                            Loan Sequence:-</td>
                        <td align="left">
                            <asp:DropDownList ID="DropDownList4" runat="server" 
                                CssClass="verysmalldropdown">
                                <asp:ListItem>Select
                                <asp:ListItem>1st Cycle
                                <asp:ListItem>2nd Cycle
                                <asp:ListItem>3rd Cycle
                                <asp:ListItem>4th Cycle
                                <asp:ListItem>5th Cycle
                                <asp:ListItem>6th Cycle
                                <asp:ListItem>7th Cycle
                                <asp:ListItem>8th Cycle
                            
                            <asp:RequiredFieldValidator ID="RequiredFieldValidator4" runat="server" 
                                ControlToValidate="DropDownList4" ErrorMessage="Please Select Loan Sequence" 
                                InitialValue="Select" SetFocusOnError="True">
                        </td>
                    </tr>
                    <tr>
                        <td align="right">
                            Loan Purpose:-</td>
                        <td align="left">
                            <asp:DropDownList ID="DropDownList5" runat="server" CssClass="smalldropdown">
                                <asp:ListItem>Select
                            
                            <asp:RequiredFieldValidator ID="RequiredFieldValidator5" runat="server" 
                                ControlToValidate="DropDownList5" ErrorMessage="Please Select Loan Purpose" 
                                InitialValue="Select">
                        </td>
                    </tr>
                    <tr>
                        <td align="right">
                            Loan Product:-</td>
                        <td align="left">
                            <asp:DropDownList ID="DropDownList6" runat="server" 
                                CssClass="verysmalldropdown" AutoPostBack="True" 
                                onselectedindexchanged="DropDownList6_SelectedIndexChanged">
                                <asp:ListItem>Select
                            
                            <asp:RequiredFieldValidator ID="RequiredFieldValidator6" runat="server" 
                                ControlToValidate="DropDownList6" ErrorMessage="Please Select Loan Product" 
                                InitialValue="Select">
                        </td>
                    </tr>
                    <tr>
                        <td align="right">
                            Loan Amount:-</td>
                        <td align="left">
                            <asp:DropDownList ID="DropDownList7" runat="server" CssClass="smalldropdown">
                                <asp:ListItem>Select
                            
                            <asp:RequiredFieldValidator ID="RequiredFieldValidator7" runat="server" 
                                ControlToValidate="DropDownList7" ErrorMessage="Please Select Amount" 
                                InitialValue="Select" SetFocusOnError="True">
                        </td>
                    </tr>
                    <tr>
                        <td align="right">
                            Proposal Date:- 
                        </td>
                        <td align="left">
                            <asp:TextBox ID="TextBox1" runat="server" CssClass="smalltext">  <asp:CalendarExtender runat="server" ID="C1" TargetControlID="TextBox1" >
                        
                            <asp:RequiredFieldValidator ID="RequiredFieldValidator8" runat="server" 
                                ControlToValidate="TextBox1" ErrorMessage="Please Enter Proposal Date" 
                                SetFocusOnError="True">
                        
                        </td>
                    </tr>
                    <tr>
                        <td align="right">
                             </td>
                        <td align="left">
                            <asp:Button ID="Button1" runat="server" CssClass="smallbutton" Text="Submit" 
                                onclick="Button1_Click" />
                        </td>
                    </tr>
                    <tr>
                        <td align="right">
                             </td>
                        <td align="left" style="color: #CC3300">
                            <asp:Literal ID="Literal3" runat="server">
                        </td>
                    </tr>
                </table>
            </td>
        </tr>
        <tr>
            <td>
                 </td>
        </tr>
    </table>
  
     
    </contenttemplate>

can some one provide any type of help ... i am tired trying this so much times ..
Posted
v3

XML
<asp:UpdatePanel ID="upnl" runat="server">
    <ContentTemplate>

    <asp:CheckBox ID="chk1" runat="server" AutoPostBack='true'  Text="check test" OnCheckedChanged="chk1_OnCheckedChanged"/>

    <asp:Button ID="Button1" runat="server"  Text="btn1"/>


    </ContentTemplate>

    </asp:UpdatePanel>
    <div id="divHide">

    <asp:UpdateProgress ID="upnldd" runat="server" DisplayAfter="1" AssociatedUpdatePanelID="upnl">
    <ProgressTemplate>
    Loading....
    </ProgressTemplate>
    </asp:UpdateProgress>

    </div>

    </div>
    <script type="text/javascript">
        var prm = Sys.WebForms.PageRequestManager.getInstance();
        prm.add_beginRequest(BeginRequestHandler);
        function BeginRequestHandler(sender, args) {
            if (args._postBackElement.id != '<%=Button1.ClientID %>')
                document.getElementById('divHide').style.display = "none";
            else
                document.getElementById('divHide').style.display = "block";
        }

</script>
 
Share this answer
 
Comments
GDdixit 1-Aug-13 7:39am    
Thank You so much bro ... ur idea work perfactly ... Thanks again bro :)
vinay.tatipamula 1-Aug-13 8:03am    
you are welcome bro.. :)
You will have to remove the AutoPostBack='True' property from all the DropDownList components which are there in the update panel.
 
Share this answer
 
v2
Comments
GDdixit 1-Aug-13 6:07am    
i can't this this my requirement bcoz here on autopost back of drop down i select the items in next drop down list ...

so it can'nt be done ...
tell some other way bro . :)
Ganesh Prakash 1-Aug-13 6:11am    
Keep the UpdateProgress and Button in a separate UpdatePanel. Hope that helps.
vinay.tatipamula 1-Aug-13 6:23am    
write pageLoad() javascript function where u can get which element causes partial postback.
Hide the Updateprogress control for all other controls causing partial postback except the Button you wanted.
GDdixit 1-Aug-13 6:39am    
how to hide update progress controls for all other controls .. how will i do this .. tell me bro ?
vinay.tatipamula 1-Aug-13 7:18am    
check the solution and let me know if it works for you?

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900