0

I'm having an issue with a modal popup extender. What I'm doing is assigning it to a "hidden" button and on the click method of a different button, I'm calling modal.Show(); When the task behind is doing nothing, or small operations, it works just fine. The issue is when I make a call to a stored procedure, it doesn't show the modal at all. What I'm trying to do is prevent user clicks and notify the user that a process is running (ie. they click on a button and it needs a few seconds to pull all the data they requested).

Has anyone run into this before? Or have any tips?

Thanks in advance for any help!

EDIT:

Heres some sample code (as requested):

The .aspx page:

   <asp:Button ID="btnStep1Hidden" runat="server" style="visibility: hidden;" />
   <asp:Button ID="Step1" Text="Pull ID Cards" OnClick="Step1_Click" UseSubmitBehavior="false" runat="server" CssClass="button_menu" />
   <ajax:ModalPopupExtender ID="mpeStep1" runat="server" PopupControlID="panProgress" TargetControlID="btnStep1Hidden" BackgroundCssClass="modalBackground"></ajax:ModalPopupExtender>

The .aspx.cs code:

    mpeStep1.Show();

    try
    {
        SqlCommand cmd = APP.DataManager.GetConnection().CreateCommand();
        cmd.CommandText = "EXEC [dbo].[sp_Populate_Initial_DataSet_New]"            cmd.Connection.Open();
        cmd.ExecuteNonQuery();
        cmd.Connection.Close();
    }
    catch
    {
        //Log, etc here
    }

There are no .DataBinds() for that stored procedure. It merely populates a table that other processes will display the data from.

SlackerCoder
  • 1,323
  • 5
  • 28
  • 53
  • Really can't help you without seeing some code. – womp Aug 18 '09 at 19:16
  • Agreed, a code sample is needed. From the vague description my guess would be that when you have it calling a stored procedure, it's throwing, returning early, or for some other reason not getting to the line where it executes modal.Show(). Or maybe you're doing a databind() in there somewhere that's resetting the visibility of your popup. But we need to see some code to narrow it down. – Sterno Aug 18 '09 at 19:54

1 Answers1

0

Is the modal popup going to say something like "please wait, processing..." ? You'll need to show it client-side rather than using mpeStep1.Show() otherwise it's not going to get around to displaying until the server-side stuff is finished anyway.

Are you using ASP.NET Ajax? If so, would the UpdateProgress control not suit the task? http://msdn.microsoft.com/en-us/library/bb386421.aspx

Town
  • 14,706
  • 3
  • 48
  • 72
  • I kind of figured this was the issue, but I was hoping there was a way around it. I wanted the page "disabled" while the longer operations were running, but I'll just use the UpdateProgress as it is now. Thanks! – SlackerCoder Aug 19 '09 at 15:33
  • I've never used it myself, but this should fit the bill nicely for what you want to do. http://encosia.com/downloads/postback-ritalin/ – Town Aug 19 '09 at 15:37