Showing posts with label contents. Show all posts
Showing posts with label contents. Show all posts

Wednesday, March 28, 2012

UpdateProgress render inline option?

UpdateProgress always seems to render the contents of <ProgressTemplate> on a new line. Any simple way to have that render inline where it is placed?

You can to do this using css styles.

<styletype="text/css">
#updateProgress1
{
display:inline;
}
</style>

Make sure that the ID of your progress control is updateProgress1.

I could see that working except that the ID of my Progress control gets some extra naming container ID's attached to it. Not being a CSS master I wonder if it were wrapped with another DIV that displayed inline shouldn't that take care of it?


Yes you can do something like that.

<div id="enclosure">
<atlas:updateprogress ... >
</div>

You can use selector as follows

#enclosure div
{
display: inline;
}


The above suggestion doesn't seem to work - as the UpdateProgress DIV is styled inline (varying between "display:none" and "display:block") - the inline "display:block" overrides the stylesheet setting.

Best soultion I could come up with was to use the following code:

<p><span class="progress"> <atlas:UpdateProgress ID="updateProgress" runat="server"> <ProgressTemplate> <img id="Img1" runat="server" src="~/Images/Progress.gif" /> Updating... </ProgressTemplate></atlas:UpdateProgress></span><asp:Button ID="testButton" runat="server" Text="Refresh" /></p>  
span.progress{ position: absoulte; left:100px;}

Using,position:absolute will take the 'progress' span out of the document flow, thus not affecting other page elements. Setting just the "left" position will move the image across from the button (which is less than 100 pxels wide)

This is by no means elegant, but achieves a goal. (and it assumes you have spare space to the left of your update button).

Other variations on this soultion could place the update indicator at the top left/right of the screen - (something like gmail does)

Would be much better if the UpdateProgress control could rendereither as a Block or Inline element!

Alternatively to all of this, you could wrap the button and Progess control in a 2 cell table...


It would be good if a RenderMode property could be added to UpdateProgress in the same way as the UpdatePanel.

The RenderMode property can be either Inline or Block, and that causes it to either output a wrapper <span> or <div> accordingly.

Just seems that the UpdateProgress is missing that property (not in July 2006 CTP anyway)

Daniel.


Actually I have just tried enclosing the UpdateProgress with a span as so:-

<span class="progress"> <atlas:UpdateProgress runat="server" ID="up1"> <ProgressTemplate> <asp:Image ID="Image1" runat="server" ImageUrl="~/images/wait.gif" /> </ProgressTemplate> </atlas:UpdateProgress></span>
 and used
span.progress div{display: inline;}
 
which works fine (July CTP).

I have it working without the inline, a float: left; did the trick.

span.progress div
{
float:left;
}

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 the user interface on a web form BEFORE UpdatePanel finishes

Hello

does anyone know if it is possible to dynamically alter the contents of a control (e.g. a label) so that it updates BEFORE the UpdatePanel finishes its asynchronous operation? An example might be for a progress bar. I have a process which takes up to 5 minutes, but which generates an event as it progresses. I want to update a control each time this event gets triggered, but because I update the user interface in the async part, it doesnt do anything until it has completed.

For example imagine I have a button with an OnClick event inside an UpdatePanel, alongside a label in the UpdatePanel.
WHen I click the button, if I loop through one hundred objects, andwish to update the contents of the label as I do this (i.e. 'On itemnumber: x'), how is this done?

Thanks

Tom.

Have you tried calling the .Update() method on your update panel in the loop? That may or may not work.


Take a look at this:http://encosia.com/2007/10/03/easy-incremental-status-updates-for-long-requests/


I did try this within the asyn call, but nothing happens. I am assuming that whatever happens is built into a long string of javascript or suchlike which is not executed until completion.

That's right. Output buffering prevents anything along those lines from working. Using an iframe lets you work more interactively.

Updating UpdatePanel contents from Popup

Welcome, can you help me solving that problem

I have a UserControl UserControl1 that contains Gridview gridview1 and input Button button1, An UpdatePanel contains UserControl1 in a page, when i press that button1 it opens a popup window which contains a input button popUpButton and a TextField, the pop up is used to add a new record to the datasource of gridview1, Then i rebind the updated datasource to gridview1, Hover the problem is the gridview1 don't render the new row added although it's datasource is updated ..!
Notes:

- I tried to use both modes of UpdatePanel (Always and Condtional) but no hope
- The UpdatePanel is in the page NOT in Usercontrol1
- There is one ScriptManager and two other update panels in same page
- I use .NET Callback interface methods When I press popUpButton IN THE popup control so that i can trigger serverside update datasource process from client side javascrip code

so how i can render that changes from datasource to gridview??

Hi

This link helps youRefresh GridView in Parent Page.

Regards.