[lnkForumImage]
TotalShareware - Download Free Software

Confronta i prezzi di migliaia di prodotti.
Asp Forum
 Home | Login | Register | Search 


 

Forums >

microsoft.public.dotnet.framework.aspnet.buildingcontrols

How to suppress Response from within a control?

Ahmet Gunes

4/13/2008 11:26:00 PM

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


2 Answers

Peter Bucher [MVP]

5/1/2008 2:50:00 PM

0

Hello AhmetG

> 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.
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.aspn... - ASP.NET Zone, die ASP.NET Community
http://www.aspn...blogs/peterbucher/ - Auf den Spuren von .NET

Steve C. Orr, MCSD

5/10/2008 6:19:00 AM

0

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://St...
http://iPhon...


"Ahmet Gunes" <gunesahm@hotmail.com> wrote in message
news:%23Kl4H3bnIHA.4712@TK2MSFTNGP04.phx.gbl...
> 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
>