473,802 Members | 1,960 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

PreRenderComple te event woe

Han
Hello

I am experiencing duplicate Page_PreRenderC omplete events. I am using
webservice in async mode.

Skeleton is,

class class1: System.Web.UI.P age
{

private int test=0;

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

protected void Page_Load(objec t sender, EventArgs e)
{
this.PreRenderC omplete += new EventHandler(Pa ge_PreRenderCom plete);

proxy1.webmetho dCompleted +=
new webmethodComple tedEventHandler (transactionCom pleted);
proxy1.webmetho dAsync();
}

}

Now the result is always,

1
2

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

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

Dont' mind.

page_prerenderC omplete 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******** ******@TK2MSFTN GP02.phx.gbl...
Hello

I am experiencing duplicate Page_PreRenderC omplete events. I am using
webservice in async mode.

Skeleton is,

class class1: System.Web.UI.P age
{

private int test=0;

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

protected void Page_Load(objec t sender, EventArgs e)
{
this.PreRenderC omplete += new EventHandler(Pa ge_PreRenderCom plete);

proxy1.webmetho dCompleted +=
new webmethodComple tedEventHandler (transactionCom pleted);
proxy1.webmetho dAsync();
}

}

Now the result is always,

1
2

...
Currently I only use the async-method's event, transactionComp leted, as
workaround. But what if I use multiple asynchronous web-methods?
begin-end-transactions set may work, but I just want PreRenderComple te 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_PreRenderC omplete events. I am using
webservice in async mode.

Skeleton is,

class class1: System.Web.UI.P age
{

private int test=0;

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

protected void Page_Load(objec t sender, EventArgs e)
{
this.PreRenderC omplete += new EventHandler(Pa ge_PreRenderCom plete);

proxy1.webmetho dCompleted +=
new webmethodComple tedEventHandler (transactionCom pleted);
proxy1.webmetho dAsync();
}

}

Now the result is always,

1
2

...
Currently I only use the async-method's event, transactionComp leted, as
workaround. But what if I use multiple asynchronous web-methods?
begin-end-transactions set may work, but I just want PreRenderComple te 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******** ******@TK2MSFTN GP04.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 PreRenderComple te 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_PreRenderC omplete events. I am using
webservice in async mode.

Skeleton is,

class class1: System.Web.UI.P age
{

private int test=0;

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

protected void Page_Load(objec t sender, EventArgs e)
{
this.PreRenderC omplete += new
EventHandler(P age_PreRenderCo mplete);

proxy1.webmetho dCompleted +=
new
webmethodCompl etedEventHandle r(transactionCo mpleted);
proxy1.webmetho dAsync();
}

}

Now the result is always,

1
2

...
Currently I only use the async-method's event, transactionComp leted, as
workaround. But what if I use multiple asynchronous web-methods?
begin-end-transactions set may work, but I just want PreRenderComple te 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
7049
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
2891
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 that applies to all these events, but I need to have specific code execute when the form closes. The properties for this method are sender (the originator) and e (event arguments). I know how to get typeof (sender) to determine what form or...
8
6089
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 uses message queues to pass pointers to Events between threads. In my app there are simple events that can be defined using an enum (for example an event called NETWORK_TIMEOUT) and more complex events that contain data (for example an event called...
13
3522
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 following issues still exist. The article shows how to find methods on a receiver that match the pattern OnXXXX given the sender. It loops through the sender events and tries to get methods from the receiver that match the pattern. For each one...
12
4145
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. However in vb.net you get continual messages (even setting the system modal property). Firstly, are these two assumptions right and if so what is the approved
41
4335
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 on some initialization information obtained elsewhere. Basically, I'm going to create my own dynamic toolbar where the toolbarbuttons can change. I'm not using the VB toolbar because of limitations in changing things like backcolor (I can't get...
9
2474
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 post event will always execuate after the system is completed... - I want to wrap this functionality in a framework, so I could possibly have 3 or 4 levels of inherited objects that need to have these pre / post events executed before and after the...
19
4759
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 DataGrid1_PageIndexChanged(object source, System.Web.UI.WebControls.DataGridPageChangedEventArgs e)
0
2008
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 possible do you think? This reason I am doing this is so the HTML can be stored in a database for auditing purposes.
0
9699
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
10304
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...
0
10063
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
9114
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
6838
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
5494
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
4270
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
3792
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2966
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.