Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > How to suppress/clear Response from within a control?

Reply
Thread Tools

How to suppress/clear Response from within a control?

 
 
Ahmet Gunes
Guest
Posts: n/a
 
      04-14-2008
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



 
Reply With Quote
 
 
 
 
bruce barker
Guest
Posts: n/a
 
      04-14-2008
protected override void Render(HtmlTextWriter writer)
{
Response.ClearContent();
// output my content

Response.End();
}


-- bruce (sqlwork.com)


"Ahmet Gunes" wrote:

> 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
>
>
>
>

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Re: How include a large array? Edward A. Falk C Programming 1 04-04-2013 08:07 PM
Frames and Response.Redirect / Response.Write - Refresh Charles A. Lackman ASP .Net 2 01-11-2006 11:44 PM
Response.Write and Response.Redirect Sehboo ASP .Net 3 12-10-2003 03:43 PM
Response.Expires and Response.Cache Promenade ASP .Net 2 12-05-2003 06:41 PM
Response.Write and Response.Redirect Matthew Wieder ASP .Net 4 07-17-2003 05:33 PM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57