更新asp.net中的进度 [英] update progress in asp.net
问题描述
我的页面上有一个更新面板和一个更新进度...
和我的更新面板包含一些下拉列表和一些按钮..
我使用下拉列表时. ..比自动发布回ococors和更新进展的工作始终.
但是我不想做..我希望仅当我使用提交"按钮(具有按钮id ="button1")提交数据时,我的更新进度才能工作
我的aspx代码是给定的...
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: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 ..
can some one provide any type of help ... i am tired trying this so much times ..
推荐答案
You will have to remove the AutoPostBack=''True'' property from all the DropDownList components which are there in the update panel.
You will have to remove the AutoPostBack=''True'' property from all the DropDownList components which are there in the update panel.
<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>
这篇关于更新asp.net中的进度的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!