473,473 Members | 1,748 Online
Bytes | Software Development & Data Engineering Community
Create Post

Home Posts Topics Members FAQ

PreRenderComplete event woe

Han
Hello

I am experiencing duplicate Page_PreRenderComplete events. I am using
webservice in async mode.

Skeleton is,

class class1: System.Web.UI.Page
{

private int test=0;

protected void Page_PreRenderComplete(Object sender, EventArgs e)
{
test++;
div1.InnerHtml += test.ToString() + "<br/>";
}

protected void Page_Load(object sender, EventArgs e)
{
this.PreRenderComplete += new EventHandler(Page_PreRenderComplete);

proxy1.webmethodCompleted +=
new webmethodCompletedEventHandler(transactionComplete d);
proxy1.webmethodAsync();
}

}

Now the result is always,

1
2

....
Currently I only use the async-method's event, transactionCompleted, as
workaround. But what if I use multiple asynchronous web-methods?
begin-end-transactions set may work, but I just want PreRenderComplete as a
neat solution.

Do you have any idea?
Dec 22 '06 #1
3 10029
Han
OOOOPS

Dont' mind.

page_prerenderComplete is a reserved event name. I just added redundant one;

Thanks for this NG. Posting always makes me brighter.

"Han" <hp****@kornet.net.koreawrote in message
news:uO**************@TK2MSFTNGP02.phx.gbl...
Hello

I am experiencing duplicate Page_PreRenderComplete events. I am using
webservice in async mode.

Skeleton is,

class class1: System.Web.UI.Page
{

private int test=0;

protected void Page_PreRenderComplete(Object sender, EventArgs e)
{
test++;
div1.InnerHtml += test.ToString() + "<br/>";
}

protected void Page_Load(object sender, EventArgs e)
{
this.PreRenderComplete += new EventHandler(Page_PreRenderComplete);

proxy1.webmethodCompleted +=
new webmethodCompletedEventHandler(transactionComplete d);
proxy1.webmethodAsync();
}

}

Now the result is always,

1
2

...
Currently I only use the async-method's event, transactionCompleted, as
workaround. But what if I use multiple asynchronous web-methods?
begin-end-transactions set may work, but I just want PreRenderComplete as
a neat solution.

Do you have any idea?

Dec 22 '06 #2
prerender complete is called twice, once by page processing and once by
your webservice callback. also you need to add a wait for the webserive
to complete. in production, you will find the callback often happens
after the page is rendered, so will have no effect on the produced html.

-- bruce (sqlwork.com)

Han wrote:
Hello

I am experiencing duplicate Page_PreRenderComplete events. I am using
webservice in async mode.

Skeleton is,

class class1: System.Web.UI.Page
{

private int test=0;

protected void Page_PreRenderComplete(Object sender, EventArgs e)
{
test++;
div1.InnerHtml += test.ToString() + "<br/>";
}

protected void Page_Load(object sender, EventArgs e)
{
this.PreRenderComplete += new EventHandler(Page_PreRenderComplete);

proxy1.webmethodCompleted +=
new webmethodCompletedEventHandler(transactionComplete d);
proxy1.webmethodAsync();
}

}

Now the result is always,

1
2

...
Currently I only use the async-method's event, transactionCompleted, as
workaround. But what if I use multiple asynchronous web-methods?
begin-end-transactions set may work, but I just want PreRenderComplete as a
neat solution.

Do you have any idea?

Dec 22 '06 #3
Han
Hi bruce

"bruce barker" <no****@nospam.comwrote in message
news:ew**************@TK2MSFTNGP04.phx.gbl...
prerender complete is called twice, once by page processing and once by
your webservice callback.
Did you see my own reply before your post? Prerender-complete event is
called once. The redundant call is raised by my wrong assignment.
Additionally, why do you think the event is called by webservice? I can't
find any comment on that on my MSDN.

---
The PreRenderComplete event is raised when the pre-render stage of the page
life cycle is complete. At this stage of the page life cycle, all controls
are created, any pagination required is completed, and the page is ready to
render to the output.
---

If your statement is correct, part of Microsoft technology should be just
big mess. Can you provide us some repro or some more stuff for your
statement?

also you need to add a wait for the webserive
to complete. in production, you will find the callback often happens after
the page is rendered, so will have no effect on the produced html.

-- bruce (sqlwork.com)

Han wrote:
>Hello

I am experiencing duplicate Page_PreRenderComplete events. I am using
webservice in async mode.

Skeleton is,

class class1: System.Web.UI.Page
{

private int test=0;

protected void Page_PreRenderComplete(Object sender, EventArgs e)
{
test++;
div1.InnerHtml += test.ToString() + "<br/>";
}

protected void Page_Load(object sender, EventArgs e)
{
this.PreRenderComplete += new
EventHandler(Page_PreRenderComplete);

proxy1.webmethodCompleted +=
new
webmethodCompletedEventHandler(transactionComplet ed);
proxy1.webmethodAsync();
}

}

Now the result is always,

1
2

...
Currently I only use the async-method's event, transactionCompleted, as
workaround. But what if I use multiple asynchronous web-methods?
begin-end-transactions set may work, but I just want PreRenderComplete as
a neat solution.

Do you have any idea?

Dec 23 '06 #4

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

Similar topics

0
by: Andy Read | last post by:
Hello all, I have the requirement to produce source code that produces an object hierarchy. Example: Root | Folder 1
18
by: Christopher W. Douglas | last post by:
I am writing a VB.NET application in Visual Studio 2003. I have written a method that handles several events, such as closing a form and changing the visible status of a form. I have some code...
8
by: Mark | last post by:
Hi, I'm looking for some ideas on how to build a very simple Event processing framework in my C++ app. Here is a quick background ... I'm building a multithreaded app in C++ (on Linux) that...
13
by: Charles Law | last post by:
Mr "yEaH rIgHt" posted the following link about a week ago in answer to my question about removing event handlers. > http://www.vbinfozine.com/t_bindevt.shtml Following on from that post, the...
12
by: Jack Russell | last post by:
My unstanding of all VB up to and including vb6 is that an event could not "interrupt" itself. For instance if you had a timer event containing a msgbox then you would only get one message. ...
41
by: JohnR | last post by:
In it's simplest form, assume that I have created a usercontrol, WSToolBarButton that contains a button. I would like to eventually create copies of WSToolBarButton dynamically at run time based...
9
by: jeff | last post by:
New VB user...developer... Situation...simplified... - I want to wrap a pre and post event around a system generated where the pre-event will always execute before the system event and the...
19
by: Daniela Roman | last post by:
Hello, I try to fire an event under a button click event and maybe anybody can give a clue please. I have let's say a WEB grid with PageIndexChanged event: private void...
0
by: DomBat | last post by:
Hello, I want to get the HTML of the page that is currently being rendered (in ASP.NET2). I have tried various things in the PreRenderComplete event, but not having much luck yet. Is this...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
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...
1
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
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,...
0
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...
0
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
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 ...

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.