473,738 Members | 9,555 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Which Page method will be called after all the controls Render methods have executed

Is there any sequence diagram on the web that clearly shows in which
order all Page methods (load, render and so on) are being called
compared to the order the page's contained control methods are being
called by the asp.net enginge ???

To be more specific, the thing I currently am most interested in
understanding is from which method in the Page class you can know that
that the Render method of all aggregated controls have been called so
that you can use the result from the processing of those methods ???
( See code example below for an example of what I want to do, and the
question is from which eventmethod in the aspx page (Page class) I
know that the render method of the control has been executed )

Or is it maybe not even possible ?
Is maybe the Render method actually sending the html to the client as
a datastream over the internet while the method is being executed ?
As far as I have understood the asp.net, the render method in the
child controls are just building up a XHTML DOM tree while executing
it, and you can at some later stage even make the control's resulting
html not be sent to the client by setting the Visible property for the
control to false from the Page that aggregates the control.

namespace MyDLL {
public class MyControl : System.Web.UI.C ontrol
{
private bool MyBool;
protected override void Render(HtmlText Writer output)
{
// some code ....
if(something) {
MyBool = true;
}
else {
MyBool = false;
}
// some code ....
}
public bool isMyBoolTrue()
{
return MyBool;
}
}
}

The aspx-page using the control above:

<%@ Register TagPrefix="MyDL L" Namespace="MyDL L" Assembly ="MyDLL"
%>
<html>&lt ;body>

<div runat="server" id="IDresult"&g t;</div>

<MyDLL:MyCon trol runat="server"
id="IDmyControl "></MyDLL:MyControl >

</body></html>
<script runat="server"& gt;
public void WHAT_NAME_SHOUL D_THIS_METHOD_H AVE() // Page_Load ,
Page_Unload , "PostRender " ... ???
{
if(IDmyControl. isMyBoolTrue())
{
IDresult.innerT ext = "OK";
}
else
{
IDresult.innerT ext = "NOT OK";
}
}
</script>
Nov 18 '05 #1
1 2170
Hi,

here are the phases explained.

http://aspalliance.com/134

If you want to know even more how to get to the Page and processing the
request, check also these articles:
http://msdn.microsoft.com/asp.net/de...ttpruntime.asp
http://msdn.microsoft.com/library/de...bjectmodel.asp

--
Teemu Keiski
MCP, Microsoft MVP (ASP.NET), AspInsiders member
ASP.NET Forum Moderator, AspAlliance Columnist
"Tomas" <Sp************ *@bahnhofbredba nd.se> wrote in message
news:mf******** *************** *********@4ax.c om...
Is there any sequence diagram on the web that clearly shows in which
order all Page methods (load, render and so on) are being called
compared to the order the page's contained control methods are being
called by the asp.net enginge ???

To be more specific, the thing I currently am most interested in
understanding is from which method in the Page class you can know that
that the Render method of all aggregated controls have been called so
that you can use the result from the processing of those methods ???
( See code example below for an example of what I want to do, and the
question is from which eventmethod in the aspx page (Page class) I
know that the render method of the control has been executed )

Or is it maybe not even possible ?
Is maybe the Render method actually sending the html to the client as
a datastream over the internet while the method is being executed ?
As far as I have understood the asp.net, the render method in the
child controls are just building up a XHTML DOM tree while executing
it, and you can at some later stage even make the control's resulting
html not be sent to the client by setting the Visible property for the
control to false from the Page that aggregates the control.

namespace MyDLL {
public class MyControl : System.Web.UI.C ontrol
{
private bool MyBool;
protected override void Render(HtmlText Writer output)
{
// some code ....
if(something) {
MyBool = true;
}
else {
MyBool = false;
}
// some code ....
}
public bool isMyBoolTrue()
{
return MyBool;
}
}
}

The aspx-page using the control above:

&lt;%@ Register TagPrefix="MyDL L" Namespace="MyDL L" Assembly ="MyDLL"
%&gt;
&lt;html&gt;&lt ;body&gt;

&lt;div runat="server" id="IDresult"&g t;&lt;/div&gt;

&lt;MyDLL:MyCon trol runat="server"
id="IDmyControl "&gt;&lt;/MyDLL:MyControl &gt;

&lt;/body&gt;&lt;/html&gt;
&lt;script runat="server"& gt;
public void WHAT_NAME_SHOUL D_THIS_METHOD_H AVE() // Page_Load ,
Page_Unload , "PostRender " ... ???
{
if(IDmyControl. isMyBoolTrue())
{
IDresult.innerT ext = "OK";
}
else
{
IDresult.innerT ext = "NOT OK";
}
}
&lt;/script&gt;

Nov 18 '05 #2

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

Similar topics

1
2268
by: magne | last post by:
I have an http module (not made by me): To connect to a server and send a request, there is a method like this: public void sendRequest(String query){ .... } When the server responds, it calls another method in the same class:
1
1243
by: John A Grandy | last post by:
somewhere in the .net framework libs , is the following intrinsically supplied 1. class-name & method that called the currently executing code 2. for overriden methods within a multi-generation class hierarchy, the class-name ultimate caller
67
3295
by: Robert | last post by:
Hi, I have been reading the article at http://www.crockford.com/javascript/private.html and I was wondering if there also was some way to be able to have private methods that can be called from public methods, but not from outside. Just throwing an exception if a private method was called from outside would be sufficient, but I don't know how to determine if the method was called from outside. Anyone else thought about doing this?
2
11889
by: Albert | last post by:
I’ve been getting this error after converting my app from .NET 1.1 to .Net 2.0. RegisterForEventValidation can only be called during Render() An error occurs when I call RenderControl(oHtmlTextWriter) method. Can’t use EnableEventValidation="false". Any help is appreciated. Thanks
4
5255
by: lakepeir | last post by:
Hello, I have combobox with a selectedindexchanged method that seems to be called when starting the application, launching the form with the combobox and making a change in the drop down box of the combobox. Can anyone tell me why the method is called so often? I would only like the method executed when a user makes a change in the drop down box. Am I using the incorrect method. Thanks.
11
16145
by: =?Utf-8?B?VHJlbnQ=?= | last post by:
I have tied an AutoCompleteExtender to a textbox to indicate suggestions to the user. Everything works fine if I utilize a webservice to fetch the results. However, I want to put the web service code into a page method. I have run the debugger only to find that the is never entered. Here are some of the things I have already tried with no success. It appears that this is a common problem. -Added the attribute to the top of the...
3
19459
by: wind | last post by:
i use the code in exporting gridview to excel and and work just fine but when i adjust it to my implementation of a search record I'm getting the said error (registerforeventvalidation can only be called during render)how will i resolved these problem without setting the EnableEventValidation to false.
2
1412
by: Jay Balapa | last post by:
Hello, We have a webservice which is called by our pocket pc apps. We have a need to filter data, so we want to add a another method on top to the existing method. Existing Service.asmx Sync(DataSet myDataset) New Service.asmx Sync(DataSet myDataset);
2
1996
by: =?Utf-8?B?Um9nZXIgTWFydGlu?= | last post by:
I am executing an AJAX page method that is a long running task. After starting the first method, I execute a second page method to retrieve the status of the task. It works fine in an empty web application, but when I paste the code into my main application (~10 projects, maybe 100 files) the behavior changes. What happens is the second page method will not begin executing until the first one finishes. In other words, the page methods...
0
8969
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9335
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
9263
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8210
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
6053
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
4825
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3279
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
2745
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2193
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.