473,287 Members | 1,426 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,287 software developers and data experts.

How to send output to browser and stop execution of events occuring after load

TS
when i try to do a response.flush and .end, the screen ends up blank. I want
all page processing to quit when a check in the pageload event fails. Since
control events occur after load, how do i keep those from firing while still
displaying the rest of the html on the page?
Jan 20 '06 #1
2 1604
KJ
To accomplish this, override RenderChildren() in the Page, and only
call base.RenderChildren() when you want the other controls to load
(when your check does not fail).

Also, if the controls you mention are web user controls (ascx), you can
override Render() and only call base.Render() in a similar manner.

Jan 20 '06 #2
Hi TS,

Regarding on the problem you mentioned, it is limited by the ASP.NET page's
serverside processing model, the page object will pass a series of events
to complete its serverside processing, and the rendering is the last step.
though we can provide a funciton to manually call class's Render method ,
but that's not recommended and is not guaranteed to work since there may
have some status not set correctly before the normal Render events
happen.... So I think the recommended means is as below:

Define a property or field in your page class to mark the flag of success
or failure, we can set that flag in page's load or init function .....

For our postback event handlers, we encapsulate the event handler's code
into a separate function and call that function only when the flag match
the expected value ....... This can prevent us from violating the ASP.NET
page's natural model...

Regards,

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)
--------------------
| From: "KJ" <n_**********@mail.com>
| Newsgroups: microsoft.public.dotnet.framework.aspnet
| Subject: Re: How to send output to browser and stop execution of events
occuring after load
| Date: 20 Jan 2006 11:21:47 -0800
| Organization: http://groups.google.com
| Lines: 7
| Message-ID: <11**********************@f14g2000cwb.googlegroups .com>
| References: <e5**************@TK2MSFTNGP15.phx.gbl>
| NNTP-Posting-Host: 69.32.176.2
| Mime-Version: 1.0
| Content-Type: text/plain; charset="iso-8859-1"
| X-Trace: posting.google.com 1137784929 25698 127.0.0.1 (20 Jan 2006
19:22:09 GMT)
| X-Complaints-To: gr**********@google.com
| NNTP-Posting-Date: Fri, 20 Jan 2006 19:22:09 +0000 (UTC)
| In-Reply-To: <e5**************@TK2MSFTNGP15.phx.gbl>
| User-Agent: G2/0.2
| X-HTTP-UserAgent: Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US;
rv:1.7.8) Gecko/20050511 Firefox/1.0.4,gzip(gfe),gzip(gfe)
| Complaints-To: gr**********@google.com
| Injection-Info: f14g2000cwb.googlegroups.com; posting-host=69.32.176.2;
| posting-account=-EvJ3wsAAABogc-QthV-9_6Q4JSAQJuo
| Path:
TK2MSFTNGXA02.phx.gbl!TK2MSFTNGP08.phx.gbl!newsfee d00.sul.t-online.de!t-onli
ne.de!border2.nntp.dca.giganews.com!border1.nntp.d ca.giganews.com!nntp.gigan
ews.com!postnews.google.com!f14g2000cwb.googlegrou ps.com!not-for-mail
| Xref: TK2MSFTNGXA02.phx.gbl
microsoft.public.dotnet.framework.aspnet:372505
| X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet
|
| To accomplish this, override RenderChildren() in the Page, and only
| call base.RenderChildren() when you want the other controls to load
| (when your check does not fail).
|
| Also, if the controls you mention are web user controls (ascx), you can
| override Render() and only call base.Render() in a similar manner.
|
|

Jan 23 '06 #3

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

Similar topics

10
by: BadOmen | last post by:
I want my program to send a mouse click to the window at the current mouse position, how do I do that? Example: I have my mouse over a button in Word and then my program is sending the left...
1
by: KwiKiwi | last post by:
Hey, I'm doing a series of XSL Transformations from a C#.NET Console app. I've designed a .xsl file (to output to "text" not "xml") to generate a text file with entries that look like: ...
17
by: lawrence | last post by:
How is it possible that the question "How do I detect which browser the user has" is missing from this FAQ: http://www.faqts.com/knowledge_base/index.phtml/fid/125 and is only here on this...
13
by: z. f. | last post by:
Hi, i have a class that is derived from System.Web.UI.Page, and this is the class i use in my application as PageBase. all other page classes are deriverd from my PageBase instead of the...
7
by: Colin Young | last post by:
I have a UserControl that contains a calendar control. The calendar is not raising events (month navigation, date selections, etc.). I've checked that the OnSelectionChanged event has a handler...
2
by: Gopal Krish | last post by:
Folks, My ASPX page uses a custom user control. What happens here is that when a runtime error occurs in the ASPX page, the error is caught in the error handler and then strangely, the execution...
0
by: Skyruner2 | last post by:
hi, I want to load an XML, and XSL file and then send the transformed XML to the client browser. i have tried this: //the classes public abstract class XMLWorker { protected XmlDocument...
0
by: Skyruner2 | last post by:
hi, I want to load an XML, and XSL file and then send the transformed XML to the client browser. i have tried this: //the classes public abstract class XMLWorker { protected XmlDocument...
6
by: Steve Hershoff | last post by:
Hi everyone, I've got a strange one here. There are two datagrids on my page, one nested within the other. I'll refer to them as the topmost and secondary datagrids. In the topmost...
0
by: MeoLessi9 | last post by:
I have VirtualBox installed on Windows 11 and now I would like to install Kali on a virtual machine. However, on the official website, I see two options: "Installer images" and "Virtual machines"....
0
by: DolphinDB | last post by:
The formulas of 101 quantitative trading alphas used by WorldQuant were presented in the paper 101 Formulaic Alphas. However, some formulas are complex, leading to challenges in calculation. Take...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: Aftab Ahmad | last post by:
So, I have written a code for a cmd called "Send WhatsApp Message" to open and send WhatsApp messaage. The code is given below. Dim IE As Object Set IE =...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: marcoviolo | last post by:
Dear all, I would like to implement on my worksheet an vlookup dynamic , that consider a change of pivot excel via win32com, from an external excel (without open it) and save the new file into a...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...

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.