all groups > asp.net building controls > april 2008 >
You're in the

asp.net building controls

group:

How to suppress Response from within a control?


How to suppress Response from within a control? Ahmet Gunes
4/14/2008 2:26:15 AM
asp.net building controls:
Hello,

I am developing a custom control.
From within this control, maybe during/before rendering, I want to totally
clear the response content and only render this control's output.
When I use Response.Clear() and/or Response.ClearContent() and/or delete
controls from the Controls collection of the Page I still get the closing
tags of form, body, and html tags in the resulting html.

Any idea?

Thanks in advance,

AhmetG

Re: How to suppress Response from within a control? Peter Bucher [MVP]
5/1/2008 4:50:15 PM
Hello AhmetG

[quoted text, click to view]
Thats a standard behavior of ASP.NET.
Whats the reason for your approach?
More details please...

--
Gruss, Peter Bucher
Microsoft MVP - Visual Developer ASP / ASP.NET, Switzerland
http://www.aspnetzone.de/ - ASP.NET Zone, die ASP.NET Community
http://www.aspnetzone.de/blogs/peterbucher/ - Auf den Spuren von .NET
Re: How to suppress Response from within a control? Steve C. Orr [MCSD, MVP, CSM, ASP Insider]
5/9/2008 11:19:09 PM
It sounds like you are clearing all of the page processing that happened
before the control is rendered, but not after.
You should be able to solve this problem by making your last line of code
this:
Response.End()

--
I hope this helps,
Steve C. Orr,
MCSD, MVP, CSM, ASPInsider
http://SteveOrr.net
http://iPhonePlaza.net


[quoted text, click to view]
AddThis Social Bookmark Button