ajax progress does not display during intial page load use javascr

  • Thread starter Thread starter cindy
  • Start date Start date
C

cindy

I am using Ajax panels to show progress when a button inside an update panel
executes a procedure “Chart2_Load†to fill a chart also inside an update
panel. It works the progress panel behaves correctly.

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 progress panel to display during the first
page load seen above? Progress panel is NOT associated with a specific
update panel.

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>
 
The UpdateProgress is for async calls to let the user know something is going
on since the browser will not. The first page load is not this type of call
and the browser is showing progress.

Not sure you really need this.

David


======================================
David McCarter [Microsoft MVP]
www.dotNetTips.com
David McCarter''s .NET Coding Standards available at:
http://codingstandards.notlong.com
 
Correct I see AJAX is not for this
It is still required on the first load of the message to display "waiting"
message and I cannot get any javascript to work I do not know if it is
because there is AJAX on page or if it is because I am too bad at script that
I am getting all the online examples wrong
Do I put the script in wrong place

CAN anyone point me to a script to say "Waiting"
tell me where to put it on the page
do I put it in script tag in head, not in head, after body, in code behind
as a register script, do I put body=onload etc what is syntax to get the
message started as the page loads and gone when it finishes loading

The page on intial load executes a procedure using default values to
populate a grid after that I use buttons Using AJAX I can get the buttons to
fill the grid and show the progress bar

Do a search on cindy either in scripting or ASP.net and you can see that
this question is a month old I got the ajax solution for the progress of
server side procedure on a click but no one can show how to display waiting
on load
--
cindy


dotNetDave said:
The UpdateProgress is for async calls to let the user know something is going
on since the browser will not. The first page load is not this type of call
and the browser is showing progress.

Not sure you really need this.

David


======================================
David McCarter [Microsoft MVP]
www.dotNetTips.com
David McCarter''s .NET Coding Standards available at:
http://codingstandards.notlong.com


cindy said:
I am using Ajax panels to show progress when a button inside an update panel
executes a procedure “Chart2_Load†to fill a chart also inside an update
panel. It works the progress panel behaves correctly.

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 progress panel to display during the first
page load seen above? Progress panel is NOT associated with a specific
update panel.

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>
 
Back
Top