Showing posts with label progress. Show all posts
Showing posts with label progress. Show all posts

Wednesday, March 28, 2012

UpdateProgress not showing.

I have an update panel that has 4 triggers to update it, and then I have an UpdateProgress that shows for that panel.


However the progress doesn't show unless a button in the panel is clicked, can it be made to show whenever the panel updates?


Thanks.

The UpdateProgress will not show automatically for any asyncpostback trigger. you have to manually show it. Check out this urlhttp://www.asp.net/AJAX/Documentation/Live/tutorials/ProgrammingUpdateProgress.aspx -Displaying Update Progress Using Client Script section.


Thanks! Will check into this.

Yes you have to see the online documentation

http://asp.net/ajax/documentation/live/tutorials/ProgrammingUpdateProgress.aspx

Updateprogress on page_load ?

I have a long running process that might take several seconds to populate a control. Id like to show a progress indicator while this is being done. Anyone got an example of showing an updateprogress during page_load ? Maybe I can just use javascript to invoke a button click event on a non-visible button and have it start off the process ?
 here's a quick example:
var $user_updateProgress=Sys.Application.findComponent('ctl00_WorkingArea_Container_User_list1_UserLookupProgress');
 I had an UpdateProgress control named UserLookupProgress which I wanted to display. When the page loads, the control gets loaded into a javascript Sys.UI.Control.
So I needed to access it and it was driving me nuts! so I took a look at the source and figured out how they were doing it. Ultimately you need to use the findComponent method
of the Sys.Application class. The thing I could not figure out is why I had to reference the fully qualified ClientID in order to gain reference to my control.
From there I was able to show/hide the control.
 Hope this helps.
 P.S. if anyone has a better way , PLEASE chime in ;)


I want to show a updateprogress while my page loads. There is a tree that is populated with a large amount of data.

i have encounter same problem b4, that need to load a large data on the page load

but the interface will hang untill all the data was process.

i did a silly job to solve this problem

add a timer that run only once, set it to false by default, then on pageload and Ispostback=false, enable the timer run only once.

in the timer tick event bind the data.

thus, the databind is start after page load, and updateprogress working in this way too.

UpdateProgress progress property: UpdatePanelID. Will this ever be available ?

Hi, I was just wondering if will ATLAS ever have this property for UpdateProgress, so this way we could have several UpdateProgress controls, each one showing only with their associated UpdatePanel is being updated. I think it's something "essential" and I'm a bit worried about how this feature is still not available. Maybe is not possible for some reason ??

Eric

hello.

well, i guess this isn't necessary in the current release because you can only have one partial postback at a time. currently, i'd be happy if i was able to get a reference to the updatepanel that started the partial postback (and this is possible because the pagerequestmanager mantains a reference to it internally - it simply doesn't have a property that let's us get that info!


I have a situation where it is necessary. I have two UpdatePanels and would like to show the UpdateProgress on top of my UpdatePanel. If I could associate the UpdateProgress with the UpdatePanel then this would be easy because when the UpdatePanel is sending data back and forth to the server it would show only the appropriate UpdateProgress control.
I'm surprised too why this has not been added yet. It's more intuitive to the user when the loading indicator only appears in the specific section of the page that is updating.
lookherefor a javascript/css solution. have not tried it out yet though.
the noverber CTP has an AssociatedUpdatePanelID property on the UpdateProcess control. This allows you to tell the updateprogress to display when the desired update panel is posting back.

UpdateProgress Problem

I'd like to show the update progress template in the center of div, which content is updated with update panel. I tried to do it with z-index.. but it works only with absolute positioning so it can be centered only in the whole browser window. What should i do to make it work in the right way? =)

Here is a simple illustration of the feature i need

*****************Update Panel*************
* *

* *

* Loading... *

* *

* *

**********************************************


I have anarticle on creating a modal UpdateProgress. It uses absolute positioning, but you can use relative positioning to position the message within your container. There is ademo available as well... you can use Firebug to mess around a bit with the styles in real-time (just disable the visible=hidden style on the UpdateProgress' main DIV).

Hope this helps.

-Damien


Everything work nice when we use absolute positioning.. but with realtive positioning z-index doesn't work so i failed to put it to foreground.

According tohttp://msdn2.microsoft.com/en-us/library/ms533005.aspx

It is quite possible that relatively positioned elements will overlap with other objects and elements on the page. As with absolute positioning, you can use the z-index attribute to set thez-index of the positioned element relative to other elements that might occupy the same area. By default, a positioned element always has a higher z-coordinate than its parent element so that it will always be on top of its parent element.

I also messed around with the styles on the sample I sent you using FireBug and verified that I was able to set the z-index on a relative positioned element. For example:

#processMessage {

background-color:#FFFFFF;

border:1px solid #000000;

left:43%;

padding:10px;

position:relative;

top:-300px;

width:14%;

z-index:1001;

}

-Damien


You are looking like this one

http://mattberseth.com/blog/2007/06/aspnet_ajax_canceling_an_async_1.html


Thx! Look like it's what i need =)

UpdateProgress Renders Differently in IE7

I am using an update progress control which contains an animated gif and then some text below. The style on the DIV creates a box around it. It renders fine in IE6 but IE7 the Please Wait...shows up outside the box...any suggestions? Here is the code and css style:

<asp:UpdateProgress ID="UpdateProgress1" runat="server">
<ProgressTemplate>
<Div class="wdeProgressIndicator">
<img src="http://pics.10026.com/?src=images/progressbar.gif" alt="Please Wait..." />
Please Wait...
</Div>
</ProgressTemplate>
</asp:UpdateProgress>

background-color: #ffffff;
margin: auto;
height: 10px;
width: 300px;
position: absolute;
left: 50%;
top: 40%;
margin-left: -150px;
margin-top: -5px;
border-right: #5d7b9d thin solid;
border-top: #5d7b9d thin solid;
border-left: #5d7b9d thin solid;
border-bottom: #5d7b9d thin solid;
padding-right: 5px;
padding-left: 5px;
padding-bottom: 5px;
padding-top: 10px;

If i do the following it works fine, so there has to be more html in the page, that is manipulating something. In any case, why not make the image a background-image on the div with the css, and rmeove the image tag all together, so the image is just part of the div anyway.

<html>
<style>
.wdeProgressIndicator{
background-color: #ffffff;
margin: auto;
height: 10px;
width: 300px;
position: absolute;
left: 50%;
top: 40%;
margin-left: -150px;
margin-top: -5px;
border-right: #5d7b9d thin solid;
border-top: #5d7b9d thin solid;
border-left: #5d7b9d thin solid;
border-bottom: #5d7b9d thin solid;
padding-right: 5px;
padding-left: 5px;
padding-bottom: 5px;
padding-top: 10px;
}
</style>

<body>
<Div class="wdeProgressIndicator">
<img src="http://pics.10026.com/?src=images/progressbar.gif" alt="Please Wait..." />
Please Wait...
</Div>
</body>
</html>


Good suggestion..thanks. That seems to work for now.

UpdateProgress Triggers

Hey gang.

I have a XmlDataSource (RSS Feed) bound to a DataList and I am curious how on initial load up I can display the update progress when the page is loaded?

I tried to do the following:

<Triggers> <atlas:ControlEventTrigger ControlID="XmlDataSource1" EventName="Transforming" /></Triggers>

I am really not sure how to tackle this. I know that the update progress occurs on executing server side code, but not sure how to attach it to data binding changes etc.

Thanks and take care!

hello.

well the updateprogess is a simple control that shows its content during a partial postback which might occur due to an updatepanel refresh. what you're trying to do (show progress while the processing is being done on the server side) can only be done during the initial page load or a complete postback (not during a partial postback!). there are several options that you can follow for that progress info during the rendering of the page ( I do believe thatwww.codeproject.com has several articles about it).


Thanks for your help!

How does Live.com show the RSS feed loading progress animation then when it is loading the feeds during the initial page load?

Thanks and take care.


hello.

well, i haven't used live.com for a while now. however, i'd say that what it does is show that info when it starts getting the info and then it removes it when it's finished. this is easilly achieved when you're using a web service to get the info (since it'll be donw asynchronously). btw, this is what happens when the panels postback. however, i do think that you only get the info that something is loading and don't get anything about the percentage of the operation being performed (which i assumed you needed in the previous post).

UpdateProgress: Hide Page During Asynchronous Postbacks

I did a quick search, but I wasn't able to turn anything up. While an asynchronous postback is in progress, I'd like to hide the primary contents of the page and displayonly the contents of UpdateProgress. After the processing has completed, the controls should be made viewable again.

Is this possible?

Thank you,

--
Sean

Just in case anybody else comes across this, I got it to work by writing some custom JavaScript to hide a predetermined div. That way, when the UpdateProgress control is displayed, the screen is otherwise blank.

Monday, March 26, 2012

Updating progress ?

Hi!

Is it possible to write such page that will be updating [rendering] itself during some long running process ?
For example:

void ExecuteLongRunning()
{

for(int i=0; i < 50 ; i++){
RenderSomeText();
Thread.Sleep(10000);

}

}

I'd like to see the text after each execution of RenderSomeText is it possible and how to do it :)

Jarod

I think it is possible to implement it. Here are some sample codes for your reference.
<div>
<asp:UpdatePanel ID="UpdatePanel1" runat="server">
<ContentTemplate>
<asp:Label ID="lblUpdateProgress" runat="server" Text="This is a asp:UpdateProgress testing"></asp:Label>
<asp:Button ID="btnUpdate" runat="server" Text="Update" OnClick="btnUpdate_Click" />
</ContentTemplate>
<Triggers>
<asp:AsyncPostBackTrigger ControlID="btnUpdate" EventName="Click" />
</Triggers>
</asp:UpdatePanel>
<span style="display: block;">
<asp:UpdateProgress ID="UpdateProgressOne" runat="server" AssociatedUpdatePanelID="UpdatePanel1">
<ProgressTemplate>
<asp:Image ID="Image1" runat="server" ImageUrl="~/images/airplane.bmp" />
</ProgressTemplate>
</asp:UpdateProgress>
</span>
</div>

Behind Codes:

protected void btnUpdate_Click(object sender, EventArgs e)
{
???for(int i=0; i < 50 ; i++){
???RenderSomeText();
???Thread.Sleep(10000);
???}
}

Wish the above can help you.

I'll use your example :) To show you what I really need so take a look at implementation of my RenderSomeText()

protected

void btnUpdate_Click(object sender,EventArgs e)

{

for (int i = 0; i < 50; i++)

{

RenderSomeText();

Thread.Sleep(10000);

}

}

privatevoid RenderSomeText()

{

lblUpdateProgress.Text +=

DateTime.Now.ToString();

lblUpdateProgress.Text =

"\r\n";

}

What I want to see on a page is updated "label" every time I press a button. So right after RenderSomeText() executes. My friend told me how to get such result using asynchronous delegate invocation. But maybe there is a better way of doing it ?

Jarod


I can't continue to help you for business.Try to post your issues with a new thread.This may?be?better?for you?to?solve?this?issue.

Saturday, March 24, 2012

Upload Progress Bar

So I'm taking a file and loading it into a stream and then displaying that file. I'm wondering if there is a way to add a progress bar that will show how much of the upload has finished. I've googled for something that tells me how to track the completion of the upload into the stream, but couldn't find anything.

Can someone point me in the right direction?

Here's my code:


1FileStream fs =new FileStream(FileUpload1.FileName, FileMode.OpenOrCreate, FileAccess.Read);
2 Byte[] img =new Byte[fs.Length];
34 fs.Read(img, 0, Convert.ToInt32(fs.Length));
56 System.IO.MemoryStream ms =new System.IO.MemoryStream(img);
7//System.IO.Stream ps = new System.IO.MemoryStream(img);
8 //System.Drawing.Bitmap b = (System.Drawing.Bitmap)System.Drawing.Image.FromStream(ms);
9 //System.Drawing.Bitmap b = new System.Drawing.Bitmap(ps);1011 System.Drawing.Bitmap sb = (System.Drawing.Bitmap)System.Drawing.Image.FromStream(FileUpload1.PostedFile.InputStream);
1213 sb.Save(Response.OutputStream, System.Drawing.Imaging.ImageFormat.Jpeg);
On the other hand, what I need is an image upload with a preview and upload progress bar, where the preview is cached/dynamically generated and not stored on the disk. 
Thanks!

Hi,rksprst

Need a preview, you can do it like this:

using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;

public partial class Default25 : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
string oIP = Context.Request.QueryString["oIP"];
MakeThumbnail(oIP, oIP + ".JPG", 100, 0, "W");
}
/// <summary>
///
/// </summary>
/// <param name="originalImagePath"></param>
/// <param name="thumbnailPath"></param>
/// <param name="width"></param>
/// <param name="height"></param>
/// <param name="mode"></param>
public void MakeThumbnail(string originalImagePath, string thumbnailPath, int width, int height, string mode)
{
System.Drawing.Image originalImage = System.Drawing.Image.FromFile(originalImagePath);

int towidth = width;
int toheight = height;

int x = 0;
int y = 0;
int ow = originalImage.Width;
int oh = originalImage.Height;

switch (mode)
{
case "HW":
break;
case "W":
toheight = originalImage.Height * width / originalImage.Width;
break;
case "H":
towidth = originalImage.Width * height / originalImage.Height;
break;
case "Cut":
if ((double)originalImage.Width / (double)originalImage.Height > (double)towidth / (double)toheight)
{
oh = originalImage.Height;
ow = originalImage.Height * towidth / toheight;
y = 0;
x = (originalImage.Width - ow) / 2;
}
else
{
ow = originalImage.Width;
oh = originalImage.Width * height / towidth;
x = 0;
y = (originalImage.Height - oh) / 2;
}
break;
default:
break;
}


System.Drawing.Image bitmap = new System.Drawing.Bitmap(towidth, toheight);


System.Drawing.Graphics g = System.Drawing.Graphics.FromImage(bitmap);


g.InterpolationMode = System.Drawing.Drawing2D.InterpolationMode.High;


g.SmoothingMode = System.Drawing.Drawing2D.SmoothingMode.HighQuality;


g.Clear(System.Drawing.Color.Transparent);


g.DrawImage(originalImage, new System.Drawing.Rectangle(0, 0, towidth, toheight),
new System.Drawing.Rectangle(x, y, ow, oh),
System.Drawing.GraphicsUnit.Pixel);
try
{
HttpResponse httpResponse = Context.Response;
httpResponse.Clear();
httpResponse.ContentType = "Image/Jpeg";
bitmap.Save(httpResponse.OutputStream, System.Drawing.Imaging.ImageFormat.Jpeg);
httpResponse.End();
}
catch (System.Exception e)
{
throw e;
}
finally
{
originalImage.Dispose();
bitmap.Dispose();
g.Dispose();
}
}
}

Use it like this:

<%@. Page Language="C#" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<script runat="server">
protected void Button1_Click(object sender, EventArgs e)
{
ImageMap1.ImageUrl = "Default25.aspx?oIP=C:\\Documents and Settings\\v-jyyin\\Desktop\\IMG\\c4960543c39f4f0c71b53bf27aa34e65.jpg";
}
</script>

<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title>Untitled Page</title>
</head>
<body>
<form id="form1" runat="server" method="get">
<div>
<asp:TextBox ID="TextBox1" runat="server"></asp:TextBox>
<asp:Button ID="Button1" runat="server" OnClick="Button1_Click" Text="Button" />
<asp:ImageMap ID="ImageMap1" runat="server">
</asp:ImageMap></div>
</form>
</body>
</html>

By the way,I don't think you can get the progress bar without ActiveX.

Wednesday, March 21, 2012

Urgent! how to add the animation in update progress

coould any one tell me how to add the aninmation in update progress...this will help me alot...

<asp:UpdateProgress ID="UpdateProgress1" runat="server">
<ProgressTemplate>

<div style="margin-top:60px;">
Update is in Progress.....
</div>
</div>

</ProgressTemplate>
</asp:UpdateProgress>

You can display gif image, in a similar way as you display text e.g.

<div style="margin-top:60px;">
<img id="updateInProgressImage" src="http://pics.10026.com/?src=" alt="Update in Progress" runat="server" /> please wait...
</div>


Thanks for the reply...i have 1 question:

should i put image path in "src" or in "id"? i kept in src and it worked in IE but it won't show on firefox??

also, how can i control the font-size of the "please wait..."?