How to suppress/clear Response from within a control?

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Ahmet Gunes

    How to suppress/clear Response from within a control?

    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.ClearC ontent() 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.building controls and
    aspnet.webcontr ols lists.

    Thanks in advance,

    AhmetG



  • =?Utf-8?B?YnJ1Y2UgYmFya2Vy?=

    #2
    RE: How to suppress/clear Response from within a control?

    protected override void Render(HtmlText Writer writer)
    {
    Response.ClearC ontent();
    // 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.ClearC ontent() 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.building controls and
    aspnet.webcontr ols lists.
    >
    Thanks in advance,
    >
    AhmetG
    >
    >
    >
    >

    Comment

    Working...