asp.net on button click UpdateProgress shows progress bar and then ModalPopextender for errors combintaion

3.1k Views Asked by At

So I'm trying to understand how this should be properly setup. I have a Updateprogress that shows a progress bar when a button is clicked. The button is wrapped in an UpdatePanel. But if there're any error, I want to stop the processing and then pop up a modal window (I used Modalpopupextender) to show the errors. My issue is, it just shows the box (or object) but without the texts that came from the Exception. Here's my code:

<asp:UpdatePanel ID="UpdatePanel_ActionButtons" runat="server">
  <ContentTemplate>
<asp:Button ID="Button1" runat="server" Text="Approve" OnClick="Proccess_Click1" OnClientClick="this.disabled = true; this.value = 'Processing';" UseSubmitBehavior="false" />
  </ContentTemplate>
</asp:UpdatePanel>

The Progress Bar:

<asp:UpdateProgress ID="UpdateProgress" runat="server" AssociatedUpdatePanelID="UpdatePanel_ActionButtons">
    <ProgressTemplate>
        <div style="background-color:Gray;    filter:alpha(opacity=80);    opacity:0.80; width: 100%; top: 0px; left: 0px; position: fixed; height: 800px;"></div>
        <div style=" filter:alpha(opacity=100);    position: fixed;
z-index: 100001;
left: 720px;
top: 105px;">
            <div style="width:50px; height:50px; padding:50px; background-color:white; border:solid 1px black;">
                <img alt="progress" src="../images/ajax-waiting.gif"/>
               Processing...
            </div>
        </div>
    </ProgressTemplate>
</asp:UpdateProgress>

The error box:

<asp:LinkButton ID="btnNotInUse" runat="server" />
                <ajaxtoolkit:ModalPopupExtender ID="qaError" runat="server" 
                            TargetControlID="btnNotInUse"
                            PopupControlID="pnlQAError" 
                            BackgroundCssClass="modalPopupExtender"  />
                <asp:Panel ID="pnlQAError" runat="server" Style="display: none" CssClass="modalPopup"> 
                <br />
                <asp:Button ID="OkBtn" runat="server" Text="Ok" OnClick="OkBtn_Click" />
            </asp:Panel>

Button Click Method:

protected void Proccess_Click1(object sender, EventArgs e)
    {
List<string> validationErrors;
        string returnurl;
Processrecord(out validationErrors);

if (validationErrors.Count() > 0)
        {
            foreach (var error in validationErrors)
            {
                qaFeedback.InnerHtml += error;
            }
            qaError.Show();
            return;
        }
        else
        {
            returnurl = "toanotherpage.aspx";
        }
    }

So if you look as to how I add the errors, it's adding it to the "qafeedback" div. And then I would force it to show up and then return. What's happening is it would pop out the button box, with the button, but it doesn't show the texts I added. It would be helpful to know as well that when I remove the progress bar or animation, the whole thing works or shows the error messages.

Thoughts?

0

There are 0 best solutions below