progress indicator long running proc NO Button click

Discussion in 'ASP .Net' started by cindy, Jun 30, 2009.

  1. cindy

    cindy Guest

    I have a procedure long running in C# asp.net 2003 app
    I need to show iframe with just a graphic (bouncing ball) inside the
    procedure and before end of procedure close the window
    I know there are more complicated solutions for a progress bar but I haave
    spent 2 weeks and I cannot get them to work
    I have a test form, click a button enter a procedure show the iframe and
    with click of second button set parent div with iframe in it display to none

    show then none

    I cannot understand why on the close I get the javascript error

    Microsoft JScript runtime error: Object required
    on line
    <script language ="javascript">
    parent.document.getElementById("cont").style.display = "none";
    which is the script that executes in close

    the code behind is

    protected void Page_Load(object sender, EventArgs e)
    {
    AddClientScript();

    }
    protected void AddClientScript()
    {
    const string scriptName = "CALL_POPUP";
    StringBuilder sb = new StringBuilder("");
    sb.Append("\n<script language =\"javascript\">");
    sb.Append("\nlast_id = \"\";");
    sb.Append("\nfunction frame_pop(id, oLeft, oTop, oPage)");
    sb.Append("\n{");
    sb.Append("\nvar mystr = window.showModalDialog('Popframe.aspx');");
    sb.Append("\nif (undefined != mystr)");
    sb.Append("\n{");
    sb.Append("\ndocument.getElementById(\"my_iframe\").style.width =
    parseInt(document.getElementById(\"cont\").style.width);");
    sb.Append("\ndocument.getElementById(\"my_iframe\").style.height =
    parseInt(document.getElementById(\"cont\").style.height);");
    sb.Append("\n}");
    sb.Append("\nif (id != last_id) {");
    sb.Append("\ndocument.getElementById(\"cont\").style.display =
    \"block\";");
    sb.Append("\ndocument.getElementById(\"cont\").style.left = oLeft;");
    sb.Append("\ndocument.getElementById(\"cont\").style.top = oTop;");
    sb.Append("\nwindow.frames[\"my_iframe\"].location = oPage;");
    sb.Append("\nlast_id = id;");
    sb.Append("\n}");
    sb.Append("\nelse {");
    sb.Append("\ndocument.getElementById(\"cont\").style.display =
    \"none\";");
    sb.Append("\nlast_id = \"\";");
    sb.Append("\n}");
    sb.Append("\nreturn false;");
    sb.Append("\n}");
    sb.Append("\n</script>");
    if (!ClientScript.IsClientScriptBlockRegistered(scriptName))
    //ClientScript.RegisterStartupScript(typeof(Page), scriptName,
    sb.ToString());
    ClientScript.RegisterClientScriptBlock(typeof(Page), scriptName,
    sb.ToString());
    }
    public static void OpenProgressBar(System.Web.UI.Page Page)
    {
    StringBuilder sbScript = new StringBuilder();
    sbScript.Append("\n<script language =\"javascript\">");
    sbScript.Append(" \n");
    sbScript.Append("\nvar newwindow = window.open('page1.aspx', 'name',
    'height=200,width=300,toolbar=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no');");
    sbScript.Append("\n</script>");
    Page.RegisterClientScriptBlock("OpenProgressBar",
    sbScript.ToString());
    }
    public static void CloseProgressBar(System.Web.UI.Page Page)
    {

    StringBuilder sbScript = new StringBuilder();
    sbScript.Append("\n<script language =\"javascript\">");

    sbScript.Append("\nparent.document.getElementById(\"cont\").style.display =
    \"none\";");
    sbScript.Append("\n</script>");
    Page.RegisterClientScriptBlock("CloseProgressBar",
    sbScript.ToString());
    }

    protected void Button1_Click(object sender, EventArgs e)
    {
    BindData();
    }
    protected void BindData()
    {
    OpenProgressBar(this.Page);
    }
    protected void BindData2()
    {
    CloseProgressBar(this.Page);
    }
    protected void Button2_Click(object sender, EventArgs e)
    {
    BindData2();
    }

    the form is
    <form id="form1" runat="server">

    <div runat="server" id="cont"
    style="position:absolute;left:300px;top:200px;width:300px;height:140px;display:none;border:1px solid #000000">
    <div runat="server" id="pop"
    style="text-align:center;background-color:#FFFFFF"> </div>

    <iframe id="my_iframe" name="my_iframe" src="" frameborder="0"></iframe>

    </div>
    <asp:Button ID="Button1" runat="server" onclick="Button1_Click"
    Text="open" />
    <asp:Button ID="Button2" runat="server" Text="close"
    onclick="Button2_Click" />
    </form>





    --
    cindy
     
    cindy, Jun 30, 2009
    #1
    1. Advertising

  2. "cindy" wrote
    > I cannot understand why on the close I get the javascript error
    >
    > Microsoft JScript runtime error: Object required
    > on line
    > <script language ="javascript">
    > parent.document.getElementById("cont").style.display = "none";
    > which is the script that executes in close


    In your code where you're generating the JavaScript, you need to use
    cont.ClientId instead of "cont":

    sb.AppendFormat("\ndocument.getElementById(\"{0}\").style.display =
    \"block\";", cont.ClientId);

    because when you put runat="server" in the div, it alters the ID when it
    renders the HTML. Just look at the source and you'll see what I mean.

    Andrew
     
    Andrew Morton, Jun 30, 2009
    #2
    1. Advertising

  3. cindy

    cindy Guest

    Still get object not found, I do not need runat for div so I simplifed the form

    <form id="form1" runat="server">

    <div id="cont"
    style="position:absolute;left:300px;top:200px;width:300px;height:140px;display:none;border:1px solid #000000">
    <div id="pop" style="text-align:center;background-color:#FFFFFF"> </div>

    <iframe id="my_iframe" name="my_iframe" src="" frameborder="0"></iframe>

    </div>
    <asp:Button ID="Button1" runat="server" onclick="Button1_Click"
    Text="open" />
    <asp:Button ID="Button2" runat="server" Text="close"
    onclick="Button2_Click" />
    </form>

    I commented out the line in the close created by javascript to use your
    suggestion but maybe I have syntax wrong


    //sbScript.Append("\nparent.document.getElementById(\"cont\").style.display
    = \"none\";");

    sbScript.AppendFormat("\ndocument.getElementById(\"cont.ClientId\").style.display = \"none\";");

    I looked in the source created below and I see <div id="cont"


    <script type="text/javascript">

    //Realised by Apachejeff
    //www.huntingground.freeserve.co.uk

    last_id = ""
    function frame_pop(id, oLeft, oTop, oPage) {
    document.getElementById("my_iframe").style.width =
    parseInt(document.getElementById("cont").style.width)
    document.getElementById("my_iframe").style.height =
    parseInt(document.getElementById("cont").style.height)
    if (id != last_id) {
    document.getElementById("cont").style.display = "block"
    document.getElementById("cont").style.left = oLeft
    document.getElementById('cont').style.top = oTop
    window.frames["my_iframe"].location = oPage

    setTimeout('document.getElementById("headertxt").innerHTML=window["my_iframe"].document.title', 200)
    last_id = id
    }
    else {
    document.getElementById('cont').style.display = "none"
    last_id = ""
    }

    return false


    }
    </script>


    <body>
    <form name="form1" method="post" action="index.aspx" id="form1">
    <div>
    <input type="hidden" name="__VIEWSTATE" id="__VIEWSTATE"
    value="/wEPDwUKMTg3NjE0NDI3MmRk6v0m9Bx5KGf3D6sGA3/cnza95QY=" />
    </div>


    <script language ="javascript">

    var newwindow = window.open('page1.aspx', 'name',
    'height=200,width=300,toolbar=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no');
    </script>
    <div>

    <input type="hidden" name="__EVENTVALIDATION" id="__EVENTVALIDATION"
    value="/wEWAwKC8enKDAKM54rGBgK7q7GGCKC1w3Vx0StuMtnTanzYGpzKBaEi" />
    </div>

    <div id="cont"
    style="position:absolute;left:300px;top:200px;width:300px;height:140px;display:none;border:1px solid #000000">
    <div id="pop" style="text-align:center;background-color:#FFFFFF"> </div>

    <iframe id="my_iframe" name="my_iframe" src="" frameborder="0"></iframe>

    </div>
    <input type="submit" name="Button1" value="open" id="Button1" />
    <input type="submit" name="Button2" value="close" id="Button2" />
    </form>
    </body>
    </html>

    here is the codebehind that creates the javascript see above in source

    public static void OpenProgressBar(System.Web.UI.Page Page)
    {
    StringBuilder sbScript = new StringBuilder();
    sbScript.Append("\n<script language =\"javascript\">");
    sbScript.Append(" \n");
    sbScript.Append("\nvar newwindow = window.open('page1.aspx', 'name',
    'height=200,width=300,toolbar=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no');");
    sbScript.Append("\n</script>");
    Page.RegisterClientScriptBlock("OpenProgressBar",
    sbScript.ToString());
    }
    public static void CloseProgressBar(System.Web.UI.Page Page)
    {

    StringBuilder sbScript = new StringBuilder();
    sbScript.Append("\n<script language =\"javascript\">");

    //sbScript.Append("\nparent.document.getElementById(\"cont\").style.display =
    \"none\";");

    sbScript.AppendFormat("\ndocument.getElementById(\"cont.ClientId\").style.display = \"none\";");
    sbScript.Append("\n</script>");
    Page.RegisterClientScriptBlock("CloseProgressBar",
    sbScript.ToString());
    }

    protected void Button1_Click(object sender, EventArgs e)
    {
    BindData();
    }
    protected void BindData()
    {
    OpenProgressBar(this.Page);
    }
    protected void BindData2()
    {
    CloseProgressBar(this.Page);
    }
    protected void Button2_Click(object sender, EventArgs e)
    {
    BindData2();
    }




    --
    cindy


    "Andrew Morton" wrote:

    > "cindy" wrote
    > > I cannot understand why on the close I get the javascript error
    > >
    > > Microsoft JScript runtime error: Object required
    > > on line
    > > <script language ="javascript">
    > > parent.document.getElementById("cont").style.display = "none";
    > > which is the script that executes in close

    >
    > In your code where you're generating the JavaScript, you need to use
    > cont.ClientId instead of "cont":
    >
    > sb.AppendFormat("\ndocument.getElementById(\"{0}\").style.display =
    > \"block\";", cont.ClientId);
    >
    > because when you put runat="server" in the div, it alters the ID when it
    > renders the HTML. Just look at the source and you'll see what I mean.
    >
    > Andrew
    >
    >
     
    cindy, Jun 30, 2009
    #3
  4. "cindy" wrote
    > Still get object not found, I do not need runat for div so I simplifed the
    > form


    Can you install Firefox and use the Firebug add-on to investigate the DOM?

    Other examples I've seen (e.g.
    http://www.sitepoint.com/forums/showthread.php?t=177654) suggest what you're
    doing is right.

    Andrew
     
    Andrew Morton, Jun 30, 2009
    #4
  5. cindy

    cindy Guest

    I have to install Firefox on another machine and move the application and
    install .net and add the addon to debug?

    How about any link to any demo using the show and close iframe using
    javascript in the code behind
    --
    cindy


    "Andrew Morton" wrote:

    > "cindy" wrote
    > > Still get object not found, I do not need runat for div so I simplifed the
    > > form

    >
    > Can you install Firefox and use the Firebug add-on to investigate the DOM?
    >
    > Other examples I've seen (e.g.
    > http://www.sitepoint.com/forums/showthread.php?t=177654) suggest what you're
    > doing is right.
    >
    > Andrew
    >
    >
     
    cindy, Jun 30, 2009
    #5
  6. "cindy" wrote
    > I have to install Firefox on another machine and move the application and
    > install .net and add the addon to debug?


    Is there any reason not to install Firefox on your dev machine? In VS, you
    can right-click on an .aspx file and choose which browser to open it with.
    Or if you run the app in IIS (this may be another can of worms) instead of
    the web server that comes with VS, you could easily access it from another
    PC. It's often a good idea to check web sites in other browsers anyway,
    unless you have a defined target audience.

    > How about any link to any demo using the show and close iframe using
    > javascript in the code behind


    I haven't seen one, but as long as your generated JS looks the same as the
    other googleable communicating-from-an-iframe-to-its-parent scripts, I don't
    see why it won't work - unless there's something awry with where in the DOM
    you should be pointing it to or there's some security thing in the browser
    preventing communication out from the iframe , but I thought the latter only
    applied to iframe content from a different domain.
    http://www.google.com/#hl=en&q=iframe parent javascript

    Does anyone else want to chime in?

    Andrew
     
    Andrew Morton, Jul 1, 2009
    #6
  7. On Jul 1, 3:32 am, "Andrew Morton" <>
    wrote:
    > "cindy" wrote
    >
    > > I have to install Firefox on another machine and move the application and
    > > install .net and add the addon to debug?

    >
    > Is there any reason not to install Firefox on your dev machine? In VS, you


    is there any reason to install Firefox to debug javascript?

    You can do it using IE and VS.NET IDE
    http://www.google.com/search?q=javascript debug ie
     
    Alexey Smirnov, Jul 1, 2009
    #7
  8. On Jun 30, 10:49 pm, cindy <> wrote:
    > I have a procedure long running in C# asp.net 2003 app
    > I need to show iframe with just a graphic (bouncing ball) inside the
    > procedure and before end of procedure close the window
    > I know there are more complicated solutions for a progress bar but I haave
    > spent 2 weeks and I cannot get them to work
    > I have a test form, click a button enter a procedure show the iframe and
    > with click of second button set parent div with iframe in it display to none
    >
    > show then none
    >
    > I cannot understand why on the close I get the javascript error
    >
    > Microsoft JScript runtime error: Object required
    > on line
    > <script language ="javascript">
    > parent.document.getElementById("cont").style.display = "none";
    >  which is the script that executes in close
    >


    What version of ASP.NET do you use?

    Simply open source code window in IE (right click - view source) and
    check if you have <div id=cont> there. It might be that you have no
    that div, or it has another id. You specified it as a server control
    (runat=server). Do you really need it? If yes, instead of
    document.getElementById('cont') use document.getElementById('<
    %=cont.ClientID%>').

    <%=cont.ClientID%> injects client id of the server control.

    If you still has a problem, post the rest of the code. For example, it
    is not clear where do you call frame_pop from.

    Hope this helps
     
    Alexey Smirnov, Jul 1, 2009
    #8
  9. Alexey Smirnov wrote:
    > is there any reason to install Firefox to debug javascript?


    Well, as far as I can tell, it appears that the problem is accesing the div
    with id="cont" from the iframe, and the Firebug add-on makes it simple to
    explore the DOM. Also, if there was a bug in IE, it might work as-is in FF,
    so a work-around could be devised (although I saw no google results
    suggesting such a bug).

    Andrew
     
    Andrew Morton, Jul 1, 2009
    #9
  10. On Jul 1, 10:46 am, "Andrew Morton" <>
    wrote:
    > Alexey Smirnov wrote:
    > > is there any reason to install Firefox to debug javascript?

    >
    > Well, as far as I can tell, it appears that the problem is accesing the div
    > with id="cont" from the iframe, and the Firebug add-on makes it simple to
    > explore the DOM. Also, if there was a bug in IE, it might work as-is in FF,
    > so a work-around could be devised (although I saw no google results
    > suggesting such a bug).
    >
    > Andrew


    Well, I use FF to debug, but because I already have it. I totally
    agree that there are some add-ons which make debug really simple, but
    seeing "Object required on line XX" in IE, I think you have clear
    message what is wrong. I already posted some hints on how to get the
    problem solved
     
    Alexey Smirnov, Jul 1, 2009
    #10
  11. cindy

    cindy Guest

    Upgraded to 2008, the app is two forms the code is all on this post
    Use the .net debugger and I break on the line

    Microsoft JScript runtime error: Object required
    on line
    <script language ="javascript">
    parent.document.getElementById("cont").style.display = "none";
    which is the script that executes in close

    the code behind is

    protected void Page_Load(object sender, EventArgs e)
    {
    AddClientScript();

    }
    protected void AddClientScript()
    {
    const string scriptName = "CALL_POPUP";
    StringBuilder sb = new StringBuilder("");
    sb.Append("\n<script language =\"javascript\">");
    sb.Append("\nlast_id = \"\";");
    sb.Append("\nfunction frame_pop(id, oLeft, oTop, oPage)");
    sb.Append("\n{");
    sb.Append("\nvar mystr = window.showModalDialog('Popframe.aspx');");
    sb.Append("\nif (undefined != mystr)");
    sb.Append("\n{");
    sb.Append("\ndocument.getElementById(\"my_iframe\").style.width =
    parseInt(document.getElementById(\"cont\").style.width);");
    sb.Append("\ndocument.getElementById(\"my_iframe\").style.height =
    parseInt(document.getElementById(\"cont\").style.height);");
    sb.Append("\n}");
    sb.Append("\nif (id != last_id) {");
    sb.Append("\ndocument.getElementById(\"cont\").style.display =
    \"block\";");
    sb.Append("\ndocument.getElementById(\"cont\").style.left = oLeft;");
    sb.Append("\ndocument.getElementById(\"cont\").style.top = oTop;");
    sb.Append("\nwindow.frames[\"my_iframe\"].location = oPage;");
    sb.Append("\nlast_id = id;");
    sb.Append("\n}");
    sb.Append("\nelse {");
    sb.Append("\ndocument.getElementById(\"cont\").style.display =
    \"none\";");
    sb.Append("\nlast_id = \"\";");
    sb.Append("\n}");
    sb.Append("\nreturn false;");
    sb.Append("\n}");
    sb.Append("\n</script>");
    if (!ClientScript.IsClientScriptBlockRegistered(scriptName))
    //ClientScript.RegisterStartupScript(typeof(Page), scriptName,
    sb.ToString());
    ClientScript.RegisterClientScriptBlock(typeof(Page), scriptName,
    sb.ToString());
    }
    public static void OpenProgressBar(System.Web.UI.Page Page)
    {
    StringBuilder sbScript = new StringBuilder();
    sbScript.Append("\n<script language =\"javascript\">");
    sbScript.Append(" \n");
    sbScript.Append("\nvar newwindow = window.open('page1.aspx', 'name',
    'height=200,width=300,toolbar=no,directories=no,status=no,menubar=no,scrollbars=no,resizable=no');");
    sbScript.Append("\n</script>");
    Page.RegisterClientScriptBlock("OpenProgressBar",
    sbScript.ToString());
    }
    public static void CloseProgressBar(System.Web.UI.Page Page)
    {

    StringBuilder sbScript = new StringBuilder();
    sbScript.Append("\n<script language =\"javascript\">");

    sbScript.Append("\nparent.document.getElementById(\"cont\").style.display =
    \"none\";");
    sbScript.Append("\n</script>");
    Page.RegisterClientScriptBlock("CloseProgressBar",
    sbScript.ToString());
    }

    protected void Button1_Click(object sender, EventArgs e)
    {
    BindData();
    }
    protected void BindData()
    {
    OpenProgressBar(this.Page);
    }
    protected void BindData2()
    {
    CloseProgressBar(this.Page);
    }
    protected void Button2_Click(object sender, EventArgs e)
    {
    BindData2();
    }

    the form is
    <form id="form1" runat="server">

    <div id="cont"
    style="position:absolute;left:300px;top:200px;width:300px;height:140px;display:none;border:1px solid #000000">
    <div id="pop"
    style="text-align:center;background-color:#FFFFFF"> </div>

    <iframe id="my_iframe" name="my_iframe" src="" frameborder="0"></iframe>

    </div>
    <asp:Button ID="Button1" runat="server" onclick="Button1_Click"
    Text="open" />
    <asp:Button ID="Button2" runat="server" Text="close"
    onclick="Button2_Click" />
    </form>





    --
    cindy

    --
    cindy


    "Mark Rae [MVP]" wrote:

    > "cindy" <> wrote in message
    > news:...
    >
    > > I have to install FireFox on another machine and move the application and
    > > install .net and add the addon to debug?

    >
    > No you don't.
    >
    > In order to debug dynamically-generated client-side JavaScript like this
    > inside Visual Studio.NET, you will need to use the debugger; keyword at the
    > top of the JavaScript routine that you intend to debug. So long as you're
    > running the web app in Debug mode, the code should break at that line:
    > http://blogs.msdn.com/ie/archive/2004/10/26/247912.aspx
    >
    > However, another major problem is: "I have a procedure long running in C#
    > asp.net 2003 app" - mainstream support for Visual Studio.NET 2003 ended last
    > year, and I'm guessing you haven't purchased an extended support contract as
    > these are very expensive:
    > http://support.microsoft.com/lifecy...alpha=Visual Studio .NET 2003&Filter=FilterNO
    > Time to upgrade...
    >
    >
    > > sbScript.Append("\n<script language =\"javascript\">");

    >
    > The language property of the <script /> tag has been deprecated for nearly
    > thirteen years now! Replace all instances of the above with:
    > sbScript.Append("\n<script type =\"text/javascript\">");
    >
    > Or, even better, once you upgrade to a more recent (and still supported!)
    > version of Visual Studio.NET, you can then use the boolean overload of
    > RegisterClientScriptBlock which will get Visual Studio.NET to generate the
    > script tags for you automatically...
    >
    >
    > --
    > Mark Rae
    > ASP.NET MVP
    > http://www.markrae.net
    >
    >
     
    cindy, Jul 1, 2009
    #11
  12. cindy wrote
    > Microsoft JScript runtime error: Object required
    > on line
    > <script language ="javascript">
    > parent.document.getElementById("cont").style.display = "none";
    > which is the script that executes in close


    OK, a little bit of testing suggests that you can't do that with an
    <iframe>. Just enclose it in a <div> and set the display style on that.

    -- this is page.html

    <html>
    <head>
    <title>Testing iframe communication</title>
    <script type="text/javascript">
    function show_iframe() {
    document.getElementById("my_iframe_container").style.display="block";
    }
    </script>
    </head>
    <body>
    <p onclick="show_iframe()">Show iframe</p>
    <div id="my_iframe_container" style="display:none">
    <iframe id="my_iframe" src="my_iframe.html" />
    </div>
    </body>
    </html>

    -- this is my_iframe.html

    <html>
    <head>
    <title>x</title>
    <script type="text/javascript">
    function hi() {
    parent.document.getElementById('my_iframe_container').style.display='none';
    }
    </script>
    </head>
    <body>
    <p onclick="hi()" style="background-color:Red">Hide me</p>
    </body>
    </html>

    You really should have tried an absolutely minimal amount of markup to test
    it - I know all too well that sometimes one can get too engrossed in some
    part of something to widen/narrow one's view to be able to focus on the
    pertinent items.

    HTH,

    Andrew
     
    Andrew Morton, Jul 1, 2009
    #12
  13. [My reply of a couple of minutes ago hasn't come through to my newsreader
    yet.]

    Oh, and when I tested that in IE8 instead of FF3.5, IE gave a message about
    blocking scripts; is it possible you've told your IE not to display messages
    about blocking scripts?

    Andrew
     
    Andrew Morton, Jul 1, 2009
    #13
  14. Andrew Morton wrote:
    > cindy wrote
    >> Microsoft JScript runtime error: Object required
    >> on line
    >> <script language ="javascript">
    >> parent.document.getElementById("cont").style.display = "none";
    >> which is the script that executes in close

    >
    > OK, a little bit of testing suggests that you can't do that with an
    > <iframe>. Just enclose it in a <div> and set the display style on
    > that.


    Pah! Silly me. Re-reading your original post I notice that /is/ what you're
    doing. Although your code is a bit obscure to me (e.g. you have a method
    BindData2() which appears to have nothing to do with binding data), I think
    that what you're trying to do is have your code-behind interact with the
    browser. That doesn't work unless you're using AJAX (or similar).

    Now you have a later version of VS, you might consider using AJAX to give a
    progress bar. Here is an article with code:
    http://www.4guysfromrolla.com/articles/050708-1.aspx

    Andrew
     
    Andrew Morton, Jul 2, 2009
    #14
  15. cindy

    cindy Guest

    I am using Ajax panels to show progress when a button executes a procedure
    “Chart2_Load†to fill a chart. It works.
    When the page loads initially the chart is filled with a default values and
    the progress bar does not show during the initial page load, this is also the
    longest time to wait for the load.

    protected void Page_Load(object sender, EventArgs e)
    {
    if (!(Page.IsPostBack))
    {
    Chart2_Load(TextStart, TextEnd);

    }
    }

    How can I show simple waiting message with Javascript or tell me what I am
    doing wrong with Ajax to get the user a message during the first page load
    seen above?

    I have included the html for the panels below.
    User requirements are to load the page initial with default values and not
    ask them to click before chart loads first time.


    <html xmlns="http://www.w3.org/1999/xhtml" >
    <head runat="server">
    <style type="text/css">……..
    </style>
    </head>
    <body>
    <form id="form1" runat="server">
    <asp:ScriptManager ID="ScriptManager1" runat="server" />
    <asp:UpdatePanel ID="QuarterUpdatePanel" runat="server"
    ChildrenAsTriggers="true" UpdateMode="Always">
    <ContentTemplate>
    <asp:DataList id="dlButtons runat="server" />
    </ContentTemplate>
    </asp:UpdatePanel>
    <asp:UpdatePanel ID="PieUpdatePanel" runat="server"
    OnLoad="PieUpdatePanel_Load" ChildrenAsTriggers="true" UpdateMode="Always">
    <ContentTemplate>
    <dotnet:Chart id="ChartPie" runat="server"/>
    </ContentTemplate>
    </asp:UpdatePanel>
    <asp:UpdateProgress ID="UpdateProgress1" runat="server"
    ChildrenAsTriggers="true" UpdateMode="Always">
    <ProgressTemplate>
    <div id="OuterTableCellOverlay">
    <div id="InnerTableCellOverlay">
    <b>... LOADING ...</b>
    <asp:Image ID="LoadImage" runat="server"
    ImageUrl="~/Images/ajax-loader.gif" />
    </div>
    </div>
    </ProgressTemplate>
    </asp:UpdateProgress>
    <asp:UpdatePanel ID="ChartUpdatePanel" runat="server"
    OnLoad="ChartUpdatePanel_Load">
    <ContentTemplate>
    <dotnet:Chart id="Chart5" runat="server"/>
    </ContentTemplate>
    </asp:UpdatePanel>
    </form>
    </body>
    </html>


    --
    cindy


    "Andrew Morton" wrote:

    > [My reply of a couple of minutes ago hasn't come through to my newsreader
    > yet.]
    >
    > Oh, and when I tested that in IE8 instead of FF3.5, IE gave a message about
    > blocking scripts; is it possible you've told your IE not to display messages
    > about blocking scripts?
    >
    > Andrew
    >
    >
     
    cindy, Jul 8, 2009
    #15
  16. cindy

    cindy Guest

    I am using Ajax panels to show progress when a button executes a procedure
    “Chart2_Load†to fill a chart. It works.
    When the page loads initially the chart is filled with a default values and
    the progress bar does not show during the initial page load, this is also the
    longest time to wait for the load.

    protected void Page_Load(object sender, EventArgs e)
    {
    if (!(Page.IsPostBack))
    {
    Chart2_Load(TextStart, TextEnd);

    }
    }

    How can I show simple waiting message with Javascript or tell me what I am
    doing wrong with Ajax to get the user a message during the first page load
    seen above?

    I have included the html for the panels below.
    User requirements are to load the page initial with default values and not
    ask them to click before chart loads first time.


    <html xmlns="http://www.w3.org/1999/xhtml" >
    <head runat="server">
    <style type="text/css">……..
    </style>
    </head>
    <body>
    <form id="form1" runat="server">
    <asp:ScriptManager ID="ScriptManager1" runat="server" />
    <asp:UpdatePanel ID="QuarterUpdatePanel" runat="server"
    ChildrenAsTriggers="true" UpdateMode="Always">
    <ContentTemplate>
    <asp:DataList id="dlButtons runat="server" />
    </ContentTemplate>
    </asp:UpdatePanel>
    <asp:UpdatePanel ID="PieUpdatePanel" runat="server"
    OnLoad="PieUpdatePanel_Load" ChildrenAsTriggers="true" UpdateMode="Always">
    <ContentTemplate>
    <dotnet:Chart id="ChartPie" runat="server"/>
    </ContentTemplate>
    </asp:UpdatePanel>
    <asp:UpdateProgress ID="UpdateProgress1" runat="server"
    ChildrenAsTriggers="true" UpdateMode="Always">
    <ProgressTemplate>
    <div id="OuterTableCellOverlay">
    <div id="InnerTableCellOverlay">
    <b>... LOADING ...</b>
    <asp:Image ID="LoadImage" runat="server"
    ImageUrl="~/Images/ajax-loader.gif" />
    </div>
    </div>
    </ProgressTemplate>
    </asp:UpdateProgress>
    <asp:UpdatePanel ID="ChartUpdatePanel" runat="server"
    OnLoad="ChartUpdatePanel_Load">
    <ContentTemplate>
    <dotnet:Chart id="Chart5" runat="server"/>
    </ContentTemplate>
    </asp:UpdatePanel>
    </form>
    </body>
    </html>


    --
    cindy
    --
    cindy


    "cindy" wrote:

    > I am using Ajax panels to show progress when a button executes a procedure
    > “Chart2_Load†to fill a chart. It works.
    > When the page loads initially the chart is filled with a default values and
    > the progress bar does not show during the initial page load, this is also the
    > longest time to wait for the load.
    >
    > protected void Page_Load(object sender, EventArgs e)
    > {
    > if (!(Page.IsPostBack))
    > {
    > Chart2_Load(TextStart, TextEnd);
    >
    > }
    > }
    >
    > How can I show simple waiting message with Javascript or tell me what I am
    > doing wrong with Ajax to get the user a message during the first page load
    > seen above?
    >
    > I have included the html for the panels below.
    > User requirements are to load the page initial with default values and not
    > ask them to click before chart loads first time.
    >
    >
    > <html xmlns="http://www.w3.org/1999/xhtml" >
    > <head runat="server">
    > <style type="text/css">……..
    > </style>
    > </head>
    > <body>
    > <form id="form1" runat="server">
    > <asp:ScriptManager ID="ScriptManager1" runat="server" />
    > <asp:UpdatePanel ID="QuarterUpdatePanel" runat="server"
    > ChildrenAsTriggers="true" UpdateMode="Always">
    > <ContentTemplate>
    > <asp:DataList id="dlButtons runat="server" />
    > </ContentTemplate>
    > </asp:UpdatePanel>
    > <asp:UpdatePanel ID="PieUpdatePanel" runat="server"
    > OnLoad="PieUpdatePanel_Load" ChildrenAsTriggers="true" UpdateMode="Always">
    > <ContentTemplate>
    > <dotnet:Chart id="ChartPie" runat="server"/>
    > </ContentTemplate>
    > </asp:UpdatePanel>
    > <asp:UpdateProgress ID="UpdateProgress1" runat="server"
    > ChildrenAsTriggers="true" UpdateMode="Always">
    > <ProgressTemplate>
    > <div id="OuterTableCellOverlay">
    > <div id="InnerTableCellOverlay">
    > <b>... LOADING ...</b>
    > <asp:Image ID="LoadImage" runat="server"
    > ImageUrl="~/Images/ajax-loader.gif" />
    > </div>
    > </div>
    > </ProgressTemplate>
    > </asp:UpdateProgress>
    > <asp:UpdatePanel ID="ChartUpdatePanel" runat="server"
    > OnLoad="ChartUpdatePanel_Load">
    > <ContentTemplate>
    > <dotnet:Chart id="Chart5" runat="server"/>
    > </ContentTemplate>
    > </asp:UpdatePanel>
    > </form>
    > </body>
    > </html>
    >
    >
    > --
    > cindy
    >
    >
    > "Andrew Morton" wrote:
    >
    > > [My reply of a couple of minutes ago hasn't come through to my newsreader
    > > yet.]
    > >
    > > Oh, and when I tested that in IE8 instead of FF3.5, IE gave a message about
    > > blocking scripts; is it possible you've told your IE not to display messages
    > > about blocking scripts?
    > >
    > > Andrew
    > >
    > >
     
    cindy, Jul 10, 2009
    #16
  17. cindy

    cindy Guest

    I have used ajax for the procedure

    All I want to do now is showing "Waiting" message before page loads if
    (!(Page.IsPostBack))
    and have message be hidden when page is loaded
    That I cannot do with Ajax
    With Ajax when a button is clicked to load the grid I can get a progress
    panel but when page loads first time it takes 30 sec for the procedure the
    fills the grid with default values to load so the user who does not look down
    to the progress indication in the browser window has no clue. is clueless
    like me on how to get somethig to work
    --
    cindy


    "Alexey Smirnov" wrote:

    > On Jun 30, 10:49 pm, cindy <> wrote:
    > > I have a procedure long running in C# asp.net 2003 app
    > > I need to show iframe with just a graphic (bouncing ball) inside the
    > > procedure and before end of procedure close the window
    > > I know there are more complicated solutions for a progress bar but I haave
    > > spent 2 weeks and I cannot get them to work
    > > I have a test form, click a button enter a procedure show the iframe and
    > > with click of second button set parent div with iframe in it display to none
    > >
    > > show then none
    > >
    > > I cannot understand why on the close I get the javascript error
    > >
    > > Microsoft JScript runtime error: Object required
    > > on line
    > > <script language ="javascript">
    > > parent.document.getElementById("cont").style.display = "none";
    > > which is the script that executes in close
    > >

    >
    > What version of ASP.NET do you use?
    >
    > Simply open source code window in IE (right click - view source) and
    > check if you have <div id=cont> there. It might be that you have no
    > that div, or it has another id. You specified it as a server control
    > (runat=server). Do you really need it? If yes, instead of
    > document.getElementById('cont') use document.getElementById('<
    > %=cont.ClientID%>').
    >
    > <%=cont.ClientID%> injects client id of the server control.
    >
    > If you still has a problem, post the rest of the code. For example, it
    > is not clear where do you call frame_pop from.
    >
    > Hope this helps
    >
     
    cindy, Jul 16, 2009
    #17
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Dale Ragan via .NET 247

    HttpHandler Progress Indicator

    Dale Ragan via .NET 247, Aug 6, 2004, in forum: ASP .Net
    Replies:
    1
    Views:
    602
    Rick Strahl [MVP]
    Aug 6, 2004
  2. David Lozzi
    Replies:
    3
    Views:
    1,952
    David Lozzi
    Jun 1, 2005
  3. Koen Janssens

    terminal progress indicator

    Koen Janssens, Nov 25, 2003, in forum: C++
    Replies:
    10
    Views:
    768
    Peter Koch Larsen
    Nov 29, 2003
  4. Replies:
    0
    Views:
    587
  5. Composer
    Replies:
    17
    Views:
    933
    Owen Jacobson
    Feb 27, 2009
Loading...

Share This Page