G
Guest
Placing runat="server" in the body tag causes discrepancies with our loading.
We require this capability to programmatically modify the body tag and add /
remove controls depending on user permissions. HOWEVER, when this tag is
added NO control which has its child items (most notably dropdownlists)
declared in the page_load function will load viewstate. The value of the
control is pulled neither in the first ProcessPostData nor the
ProcessPostData SecondTry. Creation of the child items must be moved to the
Init event to properly pull the data.
My questions are several:
1. Why are there two attempts at loading the post data in the first place?
Why aren't developers given access right away to both the init and page_load
functions seeing as how there is lots of processing before the page_load? It
seems as though this is just a waste and removes a lot of power from the
developer's hands. Why is the default function for a Page class the
page_load when that's halfway through the loading process?
2. Why would a page function normally and load viewstate for a control,
EVEN if its child items are declared in page_load, without the runat="server"
in the body but not with the tag declared?
3. Is there any way I can see the code for the inherent functions such as
what causes the trace for "ProcessPostData," etc? I'd like to know how the
system determines which events to fire based on post data. As we are
deriving from the Page class and customizing it heavily I will eventually
need to determine how to override some of this inherent behavior.
We require this capability to programmatically modify the body tag and add /
remove controls depending on user permissions. HOWEVER, when this tag is
added NO control which has its child items (most notably dropdownlists)
declared in the page_load function will load viewstate. The value of the
control is pulled neither in the first ProcessPostData nor the
ProcessPostData SecondTry. Creation of the child items must be moved to the
Init event to properly pull the data.
My questions are several:
1. Why are there two attempts at loading the post data in the first place?
Why aren't developers given access right away to both the init and page_load
functions seeing as how there is lots of processing before the page_load? It
seems as though this is just a waste and removes a lot of power from the
developer's hands. Why is the default function for a Page class the
page_load when that's halfway through the loading process?
2. Why would a page function normally and load viewstate for a control,
EVEN if its child items are declared in page_load, without the runat="server"
in the body but not with the tag declared?
3. Is there any way I can see the code for the inherent functions such as
what causes the trace for "ProcessPostData," etc? I'd like to know how the
system determines which events to fire based on post data. As we are
deriving from the Page class and customizing it heavily I will eventually
need to determine how to override some of this inherent behavior.