Showing posts with label page_load. Show all posts
Showing posts with label page_load. Show all posts

Wednesday, March 28, 2012

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.

Wednesday, March 21, 2012

Use Ajax on the label

Hi all

on the label i am using the code

protected void Page_Load(object sender, EventArgs e)
{
this.lTime.Text = Convert.ToString(DateTime.Now.TimeOfDay);
}

this is showing fised time

but i want to change the time acording to the second how this is possible?

Thanks

Hi there,

Have a look at this article

http://ajax.asp.net/docs/tutorials/IntroToTimerControl.aspx

Hope it helps ;)


You can change the label content on Javascript

1. Get the label client ID (If you're not using master page and the label is not inside an inner control it should be the
same as the ID you gve to the label)

2. Get the label by document.getElementById or $get

3. Change it's textContent property (Mozilla) or innerHTML / innerText (IE) property of the object and than the label content will change


I am getting some problem here!

I read the post 2

and make a user control name header and done all the coding on that page

after I make a master page i first cell i add a script manager then i put update panel there I drag that user control in the update panel ! That i make for the timer so it showing me the following error

Error Rendering control -UpdatePanel1

An Unhandled Exception has occured.
The control with ID 'Timer1' requires s script Manager on this page.The Script Manager must appear before any controls that need it!


Hi There,

Simple Example: NOTE SCRIPT MANAGER HAS TO BE FIRST

ASPX

<asp:ScriptManagerID="ScriptManager1"runat="server"></asp:ScriptManager>

<asp:UpdatePanelID="UpdatePanel3"runat="server">

<ContentTemplate>

<asp:TimerID="Timer1"runat="server"Interval="1000"OnTick="Timer1_Tick">

</asp:Timer>

<asp:LabelID="Label2"runat="server"Text="Label"></asp:Label>

</ContentTemplate>

</asp:UpdatePanel>

ASPX.VB

protectedvoid Timer1_Tick(object sender,EventArgs e)

{

Label2.Text =DateTime.Now.ToString();

}

IF above not working, Could you post your code here so that me or others can guide you through this.


Are you using the AJAX enabled website

I am not using that

is it necessary to use the AJAX enabled website for using the AJAX?


hi

just go through the following link

http://ajax.asp.net/docs/overview/UsingTimerControlTutorial.aspx#CodeExamples


shakti5385:

is it necessary to use the AJAX enabled website for using the AJAX?

It's not necessary, the key difference is in the web.config.

You may modify any existing web site's config file to make it work with AJAX.

Here is the documentation regarding it. http://ajax.asp.net/docs/ConfiguringASPNETAJAX.aspx