show progressbar while sending email with attachment in asp.net
I want to show status by displaying a loading/sending image while sending
email with attachment in asp.net. This is what I'm doing
<asp:UpdateProgress ID="UpdateProgress1" runat="server"
AssociatedUpdatePanelID="pnlData">
<ProgressTemplate>
<asp:Image ID="Image1" ImageUrl="~/waiting.gif"
AlternateText="Processing" runat="server" />
</ProgressTemplate>
</asp:UpdateProgress>
<asp:ModalPopupExtender ID="ModalPopupExtender1" runat="server"
TargetControlID="UpdateProgress1"
PopupControlID="UpdateProgress1">
</asp:ModalPopupExtender>
<asp:UpdatePanel ID="pnlData" runat="server">
<ContentTemplate>
<asp:FileUpload ID="FileUpload1" runat="server"/>
<asp:Button ID="Button1" runat="server" Text="Send Mail"
OnClick="Button1_Click"/>
</ContentTemplate>
<Triggers>
**<asp:AsyncPostBackTrigger ControlID="Button1"
EventName="Click"/>**
</Triggers>
</asp:UpdatePanel>
Since I'm using AsyncPostBackTrigger, when I click on Send button after
selecting the attachment, the value will be null i.e;
FileUpload1.PostedFile will be null
I tried removing the Triggers> Here value will not be null but the loading
image will not get display
Please let me know what I'm doing wrong Thanks in advance
No comments:
Post a Comment