Home | Contact Us | FAQ | Search & Site Map | Link to Us
Sign In | Join | Other 45 Sites in Network
HomeAnnouncementsFree MagazinesWhite PapersSubmit Content
Discussion GroupsASP.NETWindows FormsLanguages.NET FrameworkVisual Studio.NET
Articles.NET FrameworkASP.NETToolsWindows Forms
.NET DirectoryOpen Source ProjectsUser GroupsWeb Resources
Related Topics
Visual Basic 6SQL ServerMS AccessOther DB ProductsMS Server ProductsMore Topics ...

.NET Forum / ASP.NET / General / July 2007

Tip: Looking for answers? Try searching our database.

page_load fires with ajax call

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Dica - 30 Jul 2007 21:38 GMT
i've got a script that takes about 10 seconds to complete with page_load.
for that reason, i turned to ajax for additional dynamic updates i needed to
do on the page without having to force the user through that 10 second
delay, but it looks like page_load still gets called with an ajax submit. am
i doing something wrong with my ajax calls or is this normal?

tks
Teemu Keiski - 30 Jul 2007 21:55 GMT
Hello,

yes Page_Load is fired on the server even when using AJAX as it is crucial
part of the page lifecycle, one of the most important events. So if the
logic is something that must be done, AJAX doesn't help with that since
there's the initial loading of the Page anyway, and on async postback
(ajax's post) that same logic would take 10 seconds too, your page just
isn't halted for that 10 seconds, but you'd still need to wait 10 seconds to
get the results back.E.g browser doesn't have to stop and wait.

What you could do is that if you use ASP.NEt Ajax is that you can detect if
you're in partial postback (ScriptManager.IsInAsyncPostBack
http://www.asp.net/ajax/documentation/live/mref/P_System_Web_UI_ScriptManager_Is
InAsyncPostBack.aspx
),
so that the logic isn't executed on the additional updates anymore (only on
the initial load). Another way is to try to make the code execution parallel
with the page execution by using asynchronous features of ASP.NEt 2.0
(http://msdn.microsoft.com/msdnmag/issues/05/10/WickedCode/#S2)

Signature

Teemu Keiski
AspInsider, ASP.NET MVP
http://blogs.aspadvice.com/joteke
http://teemukeiski.net

> i've got a script that takes about 10 seconds to complete with page_load.
> for that reason, i turned to ajax for additional dynamic updates i needed
[quoted text clipped - 3 lines]
>
> tks
Dica - 31 Jul 2007 13:41 GMT
> Hello,
>
[quoted text clipped - 13 lines]
> parallel with the page execution by using asynchronous features of ASP.NEt
> 2.0 (http://msdn.microsoft.com/msdnmag/issues/05/10/WickedCode/#S2)

thanks for the links, teemu. your first suggestion works great.

>> i've got a script that takes about 10 seconds to complete with page_load.
>> for that reason, i turned to ajax for additional dynamic updates i needed
[quoted text clipped - 3 lines]
>>
>> tks
Cowboy (Gregory A. Beamer) - 30 Jul 2007 22:28 GMT
It is normal.

Signature

Gregory A. Beamer
MVP; MCP: +I, SE, SD, DBA
http://gregorybeamer.spaces.live.com
Co-author: Microsoft Expression Web Bible (upcoming)

************************************************
Think outside the box!
************************************************

> i've got a script that takes about 10 seconds to complete with page_load.
> for that reason, i turned to ajax for additional dynamic updates i needed
[quoted text clipped - 3 lines]
>
> tks
chenhong - 30 Jul 2007 23:52 GMT
can you post you code

"Dica" <genpub5@hotmail.com> дÈëÏûÏ¢ÐÂÎÅ:A%rri.84234$xk5.25981@edtnps82...
> i've got a script that takes about 10 seconds to complete with page_load.
> for that reason, i turned to ajax for additional dynamic updates i needed
[quoted text clipped - 3 lines]
>
> tks
Masudur - 31 Jul 2007 13:13 GMT
> i've got a script that takes about 10 seconds to complete with page_load.
> for that reason, i turned to ajax for additional dynamic updates i needed to
[quoted text clipped - 3 lines]
>
> tks

hi
use Ajax pro... this library don't have that problem
http://www.ajaxpro.info/

Thanks
Md. Masudur Rahman (Munna)
Kaz Software Ltd.
www.kaz.com.bd
http://munnacs.110mb.com

Rate this thread:







Free Magazines

Get these publications absolutely FREE for up to 12 months. There are no hidden fees and no obligation. Simply choose a title, complete the application form and submit it. Read more ...

Oracle MagazineNetwork ComputingComputer WorldBio-IT WorldeWeekInformation WeekInfosecurity
 
Sign In
Join
My Latest Posts
My Monitored Threads
My Blog
My Photo Gallery
My Profile
My Homepage

Start New Thread
Enable EMail Alerts
Rate this Thread



©2008 Advenet LLC   Privacy Policy - Terms of Use
This website includes both content owned or controlled by Advenet as well as content owned or controlled by third parties.