Showing posts with label load. Show all posts
Showing posts with label load. Show all posts

Wednesday, March 28, 2012

UpdateProgress subcontrols modification

I have the following code in place on my page. What I would like to do is to dynamically set the
lblProcessingRequest Text property during page load, because the site have some local language
customization build in.

I have tried a lot of things, but can't manage to get it to work.

<asp:UpdateProgressID="UpdateProgress"runat="server"AssociatedUpdatePanelID="UpdatePanel"DisplayAfter="100"DynamicLayout="False">

<ProgressTemplate><imgsrc="images/ProcessAnimation.gif"align="absMiddle"> <asp:labelID="lblProcessingRequest"Text="Processing request..."runat="server"Font-Bold="True"></asp:label></ProgressTemplate></asp:UpdateProgress>

The content is a template, so you can't immediately get at the controls like you normally can.

The template is instantiated during PreRender, so you should be able to hook into the Page's PreRenderComplete event, then do a FindControl on the update progress to get to the label:

private void PreRenderCompleteHandler(object sender, EventArgs args) {
Label l = (Label) UpdateProgress.FindControl("lblProcessingRequest");
l.Text = ""; // some localized text
}

Whenever you do this sort of thing, please, please be wary of ViewState. You should disable ViewState on that label, or you will be persisting viewstate data that doesn't need to be. If you are doing this for many labels on the page it could really add up to a problem. Read my (lengthy) article on ViewState, linked in my signature, if you have time.


ProtectedSub Page_PreRender(ByVal senderAsObject,ByVal eAs System.EventArgs)HandlesMe.PreRenderTryCType(UpdateProgress.FindControl("lblProcessingRequest"), Label).Text ="Some local Text"
Catch exAs Exception
EndTryEndSub

Sorry to say that this doesn't work. The control is not found. Couldn't this be because the label only is visible during the UpdateProgress, and at all
other time is hidden? I even tried hooking the control in the UpdateProgress PreRender method, but that didn't work eighter...


Ok, was I litte to hasty here.

Protected

Sub Page_PreRenderComplete(ByVal senderAsObject,ByVal eAs System.EventArgs)HandlesMe.PreRenderComplete

Hooking into the PreRenderComplete works fine!

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).

Monday, March 26, 2012

Updating text on page at regular intervals

Okay, I am pretty new to the Atlas/AJAX system, so im just now learning some of these tricks and whatnot. I have a page that basically needs to load a quote every 30 seconds or something. Right now, I have the page setup so that the text can be changed by clicking a javascript button without refreshing the page, but I am trying to get that function to call based on the Timer control included with atlas. any ideas for refreshing text at a regular time interval would be greatly appreciatedthe timer control would be what you want, but there's no way to tell what could be wrong without you showing some code you are trying

Hi,

this is an ideal scenario for theUpdatePanel control. The page can be refreshed at regular intervals by aTimer control. Check the following example:

<%@. 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 TheTimer_Tick(object sender, EventArgs e) { lblUpdate.Text = DateTime.Now.ToString(); }</script><html xmlns="http://www.w3.org/1999/xhtml" ><head runat="server"> <title>Untitled Page</title></head><body> <form id="form1" runat="server"> <asp:ScriptManager ID="TheScriptManager" runat="server"></asp:ScriptManager><%-- Timer --%> <asp:Timer ID="TheTimer" runat="server" Interval="2000" OnTick="TheTimer_Tick"></asp:Timer><%-- UpdatePanel --%> <asp:UpdatePanel ID="UpdatePanel1" runat="server"> <Triggers> <asp:AsyncPostBackTrigger ControlID="TheTimer" EventName="Tick" /> </Triggers> <ContentTemplate> <asp:Label ID="lblUpdate" runat="server"></asp:Label> </ContentTemplate> </asp:UpdatePanel> </form></body></html>

Saturday, March 24, 2012

Updating UpdatePanel onMouseOver

Is there any way to set an UpdatePanel to update with an onMouseOver event within an HREF?

Is there any way to have the page load and then for it to load the "UpdatePanel" and while the "Update Panel" is loading it would display the atlas:UpdateProgress?

a work around that worked for me was -

place an invisible button within the updatepanel and then when you hover over the link do a

document.getElementById(

+name of button+).click()

Which will simulate a click and obviously postback the update panel

There is probably a better way of doing this, i hope there is as i wouldnt mind knowing :)

laterz


Hey, thanks! I appreciate the post. I haven't found any other way to do it but I think this is a good idea.

Upgrade error: Could not load file or assembly Microsoft.Web.Extensions, Version=1.0.61025

I have upgraded from Beta 2 to RC1 and followed all of the upgrade instructions, but I'm still getting this error:

Error 26 Could not load file or assembly 'Microsoft.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' or one of its dependencies. The system cannot find the file specified.

I'm aware that Microsoft.Web.Extensions is now System.Web.Extensions, but I can't find where the old reference is!!!

I have searched all the files in my project for "Microsoft.Web.Extensions" as well as the machine.config. I'm currently searching every file on my hard drive for this reference and still can't find it.

Any ideas?

Thanks,

Still looking for some help...
Do you have the ControlToolkit on your site? We had that error before we updated to the newest toolkit.

I've found you have to move the DLL files form the .NET version folder on the hard drive to the bin folder in the site otherwise they need to be in the GAC.

I'm finding other problems with it. Like [no relevant source code lines] gotta be permissions or something.

Still looking...


I have the same problem and finally found out that the reference to Microsoft.Web.Extensions is in my web.config.

Have to go through and changes all "Microsoft.Web" to "System.Web" (mainly under the<pages><controls> tag).

Upgraded to March CTP and now takes forever to load .XML files from the browser!

Upgraded to March CTP and now takes forever to load .XML files from the browser! Not sure if any relation; my best guess is something to do with the new HttpHandlers/HttpModules?

I even changed my .xml files to .xml.js file with the same problem...

for quick fix, i did this, but need advice on what to do and what is happenning. basically i load xml file server to populate a dropdownlist...

<httpHandlers>

<removeverb="*"path="*.asmx"/>

<addverb="*"path="*.asmx"type="Microsoft.Web.Services.ScriptHandlerFactory"validate="false"/>

<!--

The MultiRequestHandler enables multiple requests to be handled in one

roundtrip to the server. Its use requires Full Trust.

-->

<!--add verb="*" path="atlasbatchcall.axd" type="Microsoft.Web.Services.MultiRequestHandler" validate="false"/-->

<addverb="*"path="atlasglob.axd"type="Microsoft.Web.Globalization.GlobalizationHandler"validate="false"/>

<addverb="*"path="*.asbx"type="Microsoft.Web.Services.ScriptHandlerFactory"validate="false"/>

</httpHandlers>

<httpModules>

<addname="ScriptModule"type="Microsoft.Web.Services.ScriptModule"/>

<!--add name="BridgeModule" type="Microsoft.Web.Services.BridgeModule"/>

<add name="WebResourceCompression" type="Microsoft.Web.Services.WebResourceCompressionModule"/-->

</httpModules>

Upgraded to AJAX Beta 2 - Now getting IE error Operation Aborted

...and page fails to load. If you refresh all is ok.

All I have used is Autoextender and updatepanel on the page with a master page.

Any ideas what this bug is and how to fix it?

MasterPage/ContentPage Scenarios
You may have a ScriptManager on your master page, but you may want to add additional script or service references in your content page. However, you can only have one ScriptManager on your page. Therefore we have the accompanying ScriptManagerProxy control.
<asp:Content ...>
<atlas:ScriptManagerProxy runat="server" id="scriptManagerProxy">
...
</atlas:ScriptManagerProxy>
</asp:Content

hello.

difficult to say what's happening without getting more info about the error...


I also upgraded to Beta 2 and now getting this error : but it is intermitant and really dont know what bit of code is doing it.

www.destinationrussia.com

Any ideas?


Hi,

I installed Ajax Beta 2 and future CTP Novemner in my PC.I could accesswww.destinationrussia.com through IE 7.0,FireFox and Opera and found the web page was loaded correctly for the first time.There are no any browser errors happened.Can you post some error message here?


Jasson_King:

Hi,

I installed Ajax Beta 2 and future CTP Novemner in my PC.I could accesswww.destinationrussia.com through IE 7.0,FireFox and Opera and found the web page was loaded correctly for the first time.There are no any browser errors happened.Can you post some error message here?

its a very intermittant error... i am driving myself crazy dealing with it to, as i cannot replicate it on demand

Luis Abreu:

hello.

difficult to say what's happening without getting more info about the error...

Want more info?
http://forums.asp.net/thread/1471506.aspx
http://weblogs.asp.net/infinitiesloop/archive/2006/11/02/Dealing-with-IE-_2600_quot_3B00_Operation-Aborted_2600_quot_3B002E00_-Or_2C00_-how-to-Crash-IE.aspx
http://www.ryangrant.net/archives/internet-explorer-cannot-open-the-internet-site-operation-aborted-google-map-api/

This error is indeed a tough one to track down