AJAX progress does not work on initial page load

Discussion in 'ASP .Net' started by cindy, Jul 10, 2009.

  1. 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, Jul 10, 2009
    #1
    1. Advertising

  2. cindy

    bruce barker Guest

    you need to do an ajax callback to load the chart. this will require
    some javascript, as the panel's require a client event to fire them. the
    easiest to just have a startup script fire the event.


    Sys.Application.add_load(function() {
    window.setTimeout(function(){
    __doPostBack('<%=PieUpdatePanel.ClientId%>')
    });
    });


    -- bruce (sqlwork.com)

    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>
    >
    >
    bruce barker, Jul 11, 2009
    #2
    1. Advertising

  3. cindy

    cindy Guest

    I added this to the head
    <head>
    <script type="text/javascript">
    Sys.Application.add_load(function() {
    window.setTimeout(function(){
    __doPostBack('<%=PieUpdatePanel.ClientId%>')
    });
    });
    </script>
    </head>

    and I get this error

    Compilation Error
    Description: An error occurred during the compilation of a resource required
    to service this request. Please review the following specific error details
    and modify your source code appropriately.

    Compiler Error Message: CS1061: 'System.Web.UI.UpdatePanel' does not contain
    a definition for 'ClientId' and no extension method 'ClientId' accepting a
    first argument of type 'System.Web.UI.UpdatePanel' could be found (are you
    missing a using directive or an assembly reference?)

    Source Error:



    Line 45: Sys.Application.add_load(function() {
    Line 46: window.setTimeout(function(){
    Line 47: __doPostBack('<%=PieUpdatePanel.ClientId%>')
    Line 48: });
    Line 49: });


    --
    cindy


    "bruce barker" wrote:

    > you need to do an ajax callback to load the chart. this will require
    > some javascript, as the panel's require a client event to fire them. the
    > easiest to just have a startup script fire the event.
    >
    >
    > Sys.Application.add_load(function() {
    > window.setTimeout(function(){
    > __doPostBack('<%=PieUpdatePanel.ClientId%>')
    > });
    > });
    >
    >
    > -- bruce (sqlwork.com)
    >
    > 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, Jul 13, 2009
    #3
  4. cindy

    cindy Guest

    Please don't let this thread die I have posted the question in 3 other places
    and this is the only faint response I have I am just trying bottom line to
    get anything that will display to tell the user that the INITIAL page is
    loading

    I am new to AJAX and this worked when on the page there is a button and the
    grid load due to the button click
    On the initial page load the same procedure in the button click executes
    using default values so actually once the page starts to load causing a
    second postback in a panel won't work

    If javascript is the answer I also cannot get anybody to get me a script
    that works to display a simple message and I have used all those examples on
    the web but either I am completely ignorant and placing the script wrong or
    it is because I am using an aspx page with Ajax or I am clueless

    Just asking given the page below what will display a simple message when
    load STARTS and hide message when INITIAL LOAD COMPLETES. Also because of my
    previous failures to implement how do I place on the page markup
    As a <script> tag if so where
    As a register startup if so when and where
    I have been in these threads trying to get an answer since the middle of
    June please help
    --
    cindy


    "bruce barker" wrote:

    > you need to do an ajax callback to load the chart. this will require
    > some javascript, as the panel's require a client event to fire them. the
    > easiest to just have a startup script fire the event.
    >
    >
    > Sys.Application.add_load(function() {
    > window.setTimeout(function(){
    > __doPostBack('<%=PieUpdatePanel.ClientId%>')
    > });
    > });
    >
    >
    > -- bruce (sqlwork.com)
    >
    > 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, Jul 15, 2009
    #4
  5. cindy

    Terry Guest

    To the best of my knowledge you cannot get the AJAX progress panel to display
    when the page first loads. For it to display, as in a post-back, it needs to
    be initialised within the page and it isn't when the page is first called.

    You would also have the same problem trying to do this with javascript for
    exactly the same reason, though I stand to be corrected.


    "MAQ" wrote:

    > Hi Cindy
    >
    > Have you got answer for this question? I am also trying the same that you
    > are trying to do but unable to find any solution for this problem. If you get
    > answer Please let me know as well
    >
    > Thanks
    > Maqsood
    >
    > "cindy" wrote:
    >
    > > Please don't let this thread die I have posted the question in 3 other places
    > > and this is the only faint response I have I am just trying bottom line to
    > > get anything that will display to tell the user that the INITIAL page is
    > > loading
    > >
    > > I am new to AJAX and this worked when on the page there is a button and the
    > > grid load due to the button click
    > > On the initial page load the same procedure in the button click executes
    > > using default values so actually once the page starts to load causing a
    > > second postback in a panel won't work
    > >
    > > If javascript is the answer I also cannot get anybody to get me a script
    > > that works to display a simple message and I have used all those examples on
    > > the web but either I am completely ignorant and placing the script wrong or
    > > it is because I am using an aspx page with Ajax or I am clueless
    > >
    > > Just asking given the page below what will display a simple message when
    > > load STARTS and hide message when INITIAL LOAD COMPLETES. Also because of my
    > > previous failures to implement how do I place on the page markup
    > > As a <script> tag if so where
    > > As a register startup if so when and where
    > > I have been in these threads trying to get an answer since the middle of
    > > June please help
    > > --
    > > cindy
    > >
    > >
    > > "bruce barker" wrote:
    > >
    > > > you need to do an ajax callback to load the chart. this will require
    > > > some javascript, as the panel's require a client event to fire them. the
    > > > easiest to just have a startup script fire the event.
    > > >
    > > >
    > > > Sys.Application.add_load(function() {
    > > > window.setTimeout(function(){
    > > > __doPostBack('<%=PieUpdatePanel.ClientId%>')
    > > > });
    > > > });
    > > >
    > > >
    > > > -- bruce (sqlwork.com)
    > > >
    > > > 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>
    > > > >
    > > > >
    > > >
    Terry, Sep 29, 2009
    #5
  6. cindy

    Daniel Ulfe Guest

    Check the thread with title "page loading message showing before load
    page and then gone on" in the scripting group...

    It will show you an alternative.

    Daniel.

    Terry wrote:
    > To the best of my knowledge you cannot get the AJAX progress panel to display
    > when the page first loads. For it to display, as in a post-back, it needs to
    > be initialised within the page and it isn't when the page is first called.
    >
    > You would also have the same problem trying to do this with javascript for
    > exactly the same reason, though I stand to be corrected.
    >
    >
    > "MAQ" wrote:
    >
    >> Hi Cindy
    >>
    >> Have you got answer for this question? I am also trying the same that you
    >> are trying to do but unable to find any solution for this problem. If you get
    >> answer Please let me know as well
    >>
    >> Thanks
    >> Maqsood
    >>
    >> "cindy" wrote:
    >>
    >>> Please don't let this thread die I have posted the question in 3 other places
    >>> and this is the only faint response I have I am just trying bottom line to
    >>> get anything that will display to tell the user that the INITIAL page is
    >>> loading
    >>>
    >>> I am new to AJAX and this worked when on the page there is a button and the
    >>> grid load due to the button click
    >>> On the initial page load the same procedure in the button click executes
    >>> using default values so actually once the page starts to load causing a
    >>> second postback in a panel won't work
    >>>
    >>> If javascript is the answer I also cannot get anybody to get me a script
    >>> that works to display a simple message and I have used all those examples on
    >>> the web but either I am completely ignorant and placing the script wrong or
    >>> it is because I am using an aspx page with Ajax or I am clueless
    >>>
    >>> Just asking given the page below what will display a simple message when
    >>> load STARTS and hide message when INITIAL LOAD COMPLETES. Also because of my
    >>> previous failures to implement how do I place on the page markup
    >>> As a <script> tag if so where
    >>> As a register startup if so when and where
    >>> I have been in these threads trying to get an answer since the middle of
    >>> June please help
    >>> --
    >>> cindy
    >>>
    >>>
    >>> "bruce barker" wrote:
    >>>
    >>>> you need to do an ajax callback to load the chart. this will require
    >>>> some javascript, as the panel's require a client event to fire them. the
    >>>> easiest to just have a startup script fire the event.
    >>>>
    >>>>
    >>>> Sys.Application.add_load(function() {
    >>>> window.setTimeout(function(){
    >>>> __doPostBack('<%=PieUpdatePanel.ClientId%>')
    >>>> });
    >>>> });
    >>>>
    >>>>
    >>>> -- bruce (sqlwork.com)
    >>>>
    >>>> 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>
    >>>>>
    >>>>>
    Daniel Ulfe, Sep 30, 2009
    #6
  7. cindy

    big_M Guest

    I did something like this a while ago using ajax, it might help you, havent
    got the code to hand but heres the basic method...

    Use a ajax timer, update panel and update progress controls.

    Start the timer running in page load, tick of 2 seconds.

    On the timer tick event, stop the timer and run your code from here instead
    of page load.





    "cindy" wrote:

    > Please don't let this thread die I have posted the question in 3 other places
    > and this is the only faint response I have I am just trying bottom line to
    > get anything that will display to tell the user that the INITIAL page is
    > loading
    >
    > I am new to AJAX and this worked when on the page there is a button and the
    > grid load due to the button click
    > On the initial page load the same procedure in the button click executes
    > using default values so actually once the page starts to load causing a
    > second postback in a panel won't work
    >
    > If javascript is the answer I also cannot get anybody to get me a script
    > that works to display a simple message and I have used all those examples on
    > the web but either I am completely ignorant and placing the script wrong or
    > it is because I am using an aspx page with Ajax or I am clueless
    >
    > Just asking given the page below what will display a simple message when
    > load STARTS and hide message when INITIAL LOAD COMPLETES. Also because of my
    > previous failures to implement how do I place on the page markup
    > As a <script> tag if so where
    > As a register startup if so when and where
    > I have been in these threads trying to get an answer since the middle of
    > June please help
    > --
    > cindy
    >
    >
    > "bruce barker" wrote:
    >
    > > you need to do an ajax callback to load the chart. this will require
    > > some javascript, as the panel's require a client event to fire them. the
    > > easiest to just have a startup script fire the event.
    > >
    > >
    > > Sys.Application.add_load(function() {
    > > window.setTimeout(function(){
    > > __doPostBack('<%=PieUpdatePanel.ClientId%>')
    > > });
    > > });
    > >
    > >
    > > -- bruce (sqlwork.com)
    > >
    > > 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>
    > > >
    > > >

    > >
    big_M, Nov 19, 2009
    #7
    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. Ian Murphy

    *very* slow initial page load

    Ian Murphy, Jan 20, 2005, in forum: ASP .Net
    Replies:
    13
    Views:
    9,938
    mwalshe2000
    Jun 17, 2008
  2. Charlie Zhang
    Replies:
    3
    Views:
    1,250
    Paul Lutus
    Aug 16, 2004
  3. cindy
    Replies:
    2
    Views:
    4,879
    cindy
    Jul 16, 2009
  4. Eric Wong
    Replies:
    0
    Views:
    133
    Eric Wong
    Nov 11, 2009
  5. Mike Dee
    Replies:
    3
    Views:
    317
    Mamidipalli
    Mar 1, 2006
Loading...

Share This Page