How to suppress/clear Response from within a control?

A

Ahmet Gunes

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.
Since the Render event of the page is protected I can not attach an event
handler at runtime.
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.

I wonder if that's possible..

P.S. A similar message was also posted on aspnet.buildingcontrols and
aspnet.webcontrols lists.

Thanks in advance,

AhmetG
 
B

bruce barker

protected override void Render(HtmlTextWriter writer)
{
Response.ClearContent();
// output my content

Response.End();
}


-- bruce (sqlwork.com)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,578
Members
45,052
Latest member
LucyCarper

Latest Threads

Top