473,395 Members | 1,974 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

Control events - page life-cycle

I want to build a set of compiled user controls to incorporate into a web
site.

The majority of user controls will be placed on specific web page and these
controls would share a common interface. The interface would expect some
sort of "end user identitifier" argument, perhaps a GUID.

I thought that this user identifier GUID could be generated by a common user
control (either from state information held on the client cookies, or in the
database or where-ever...). This common control would therefore be best
placed on a master page that was inherited by all the web pages.

The problem is of course the event life cycle...
1. Default Page's Control's Page_Init()
2. Master Page's Control's Page_Init()
3. Master Page's Page_Init()
4. Default Page's Page_Init()
5. Default Page's Page_Load()
6. Master Page's Page_Load()
7. Default Page's Control's Page_Load()
8. Master Page's Control's Page_Load()

I'd obviously require the common control (on the master page) to fire BEFORE
the specific control on the page....and this won't happen.

I'm sure that this is a common problem, but am having a hard time finding a
suitable work-around. Any help most appreciated.

Thanks

Griff

Sep 20 '06 #1
3 2413
Here is an option: Set up a property on the control in question and use the
property load to set the control to the state you desire.

--
Gregory A. Beamer
MVP; MCP: +I, SE, SD, DBA

*************************************************
Think outside of the box!
*************************************************
"Griff" <ho*****@the.moonwrote in message
news:%2****************@TK2MSFTNGP05.phx.gbl...
>I want to build a set of compiled user controls to incorporate into a web
site.

The majority of user controls will be placed on specific web page and
these controls would share a common interface. The interface would expect
some sort of "end user identitifier" argument, perhaps a GUID.

I thought that this user identifier GUID could be generated by a common
user control (either from state information held on the client cookies, or
in the database or where-ever...). This common control would therefore be
best placed on a master page that was inherited by all the web pages.

The problem is of course the event life cycle...
1. Default Page's Control's Page_Init()
2. Master Page's Control's Page_Init()
3. Master Page's Page_Init()
4. Default Page's Page_Init()
5. Default Page's Page_Load()
6. Master Page's Page_Load()
7. Default Page's Control's Page_Load()
8. Master Page's Control's Page_Load()

I'd obviously require the common control (on the master page) to fire
BEFORE the specific control on the page....and this won't happen.

I'm sure that this is a common problem, but am having a hard time finding
a suitable work-around. Any help most appreciated.

Thanks

Griff

Sep 20 '06 #2
Hi Gregory

So, just thinking this through, the following steps would need to occur in
sequence

In the web page load event
1 - WebPage.UserControl.UserID = MasterPage.UserControl.GetUserGuid()
2 - WebPage.UserControl.GenerateOutput()

Yup - think that would work....thanks

Griff
"Cowboy (Gregory A. Beamer)" <No************@comcast.netNoSpamMwrote in
message news:uG**************@TK2MSFTNGP06.phx.gbl...
Here is an option: Set up a property on the control in question and use
the property load to set the control to the state you desire.

Sep 20 '06 #3
Hi Gregory

I seem to have hit a bit of a stumbling block....

I want the Master Page's control to generate a GUID that identifies the end
user. This will be on a Master page because I want it on EVERY web page. I
presume that the earliest that this function could be called would be AFTER
the Master Page's Control's Page_Load() event has been fired.

I then want the web page's Control to take in this GUID and then, based on
some business logic, load another specific User Control at run time. Using
the MVC model, it's a way of saying that the View used by every control is
dependent upon the user calling it.

But it appears that the event order prevents this....

Griff

"Cowboy (Gregory A. Beamer)" <No************@comcast.netNoSpamMwrote in
message news:uG**************@TK2MSFTNGP06.phx.gbl...
Here is an option: Set up a property on the control in question and use
the property load to set the control to the state you desire.

Sep 20 '06 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Ole Hanson | last post by:
Hi I am having a number of User Controls (ascx) on my page (aspx). The page is in my scenario only working as a dumb "container "giving life to the Controls, as these are handling my UI-logic...
8
by: John Smith Jr. | last post by:
I am looking for some way to persist a table web control so when page_load event comes up, i can display the table as it was. I tried using ViewState with the rows collection but that didn't work...
1
by: Earl Teigrob | last post by:
PROBLEM: When a user control is loaded into a PlaceHolder control more than once, the events do not fire on the first click of a control on the dynamically loaded user control. In other words, the...
10
by: George G. | last post by:
Hi there, I am busy writing a new asp.net application and I am reusing some of my existing asp functions and methods in a user control. I need access to session, request and response in some of...
6
by: MattB | last post by:
I have a page header that I made as a user control (ascx) that I drop on every page in my application. The application is an eCommerce application and I have a total for items in the cart on the...
3
by: Tome73 | last post by:
Could someone give me a comprehensive order of events as they pertain to web controls within a page. The page events are: Page_Init Page_Load Page_PreRender Page_Unload Page_Disposed So...
0
by: Klaus Jensen | last post by:
Hi! This has been annoying me for a while now, and I can't get it to work It is really driving me nuts! Basicly this simple webapp created to illustrate my problem, renders five buttons, and...
4
by: thomson | last post by:
Hi all, i do have a user control with 4 buttons, and all the events are firing properly, My problem is that i need to right an event handler in the user control, which gets fired after a...
9
by: Gummy | last post by:
Hello, I created a user control that has a ListBox and a RadioButtonList (and other stuff). The idea is that I put the user control on the ASPX page multiple times and each user control will...
1
by: Jordan S. | last post by:
I'm just wondering if this would work. Please note that I'm not asking *how* to raise events. I'm clear on that. What I'm not clear on is the sequence in which events are raised by custom controls...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.