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 / Web Controls / May 2008

Tip: Looking for answers? Try searching our database.

Control event that fires before PageLoad? Is it possible?

Thread view: 
Enable EMail Alerts  Start New Thread
Thread rating: 
Strife_SD - 07 May 2008 21:46 GMT
Hello,

I'm trying to develop a custom grid pager control. I would like it so that
the user clicks the page change button on the control and the page does a
post back and the server control changes the page number, the page then loads
the data and binds it to the gird via the PageLoad event.  The problem is
that the grid page change event occurs after the PageLoad, so the correct
page number is not updated in time for the data call.  I've got around the
problem by moving the data call  \ databind of the grid to the PreRender
event, which occurs after the page change event, but if I turn viewstate off
on the grid the page change event never fires. I'm assuming this occurs
because the PreRender is late in the page life cycle and the control can not
load it's state?  The Telerik grid that I'm using requires that the grid
pager be created dynamically, every time the page is loaded.  I'm new to
custom server controls.  Does anyone know how to make it so the control can
process the data before the pageload fires?  Thanks
Peter Bucher [MVP] - 07 May 2008 22:18 GMT
Hello Strife

<Control>.OnInit fires before <Page>.OnLoad.
See: http://www.aspnetzone.de/photos/peterbucher/images/182900/original.aspx

Otherwise you can make use of <Page>.PreRender

Signature

Gruss, Peter Bucher
Microsoft MVP - Visual Developer ASP / ASP.NET, Switzerland
http://www.aspnetzone.de/ - ASP.NET Zone, die ASP.NET Community
http://www.aspnetzone.de/blogs/peterbucher/ - Auf den Spuren von .NET

> Hello,
>
[quoted text clipped - 16 lines]
> can
> process the data before the pageload fires?  Thanks

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.