How to suppress all Response content 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.
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
 
A

AhmetG

Thanks for your reply Patrice...

What I am trying to do is to develop a custom control similar to
LiveControls at www.dart.com.
The most important feature of those controls is being able to use ViewState
and raise server-side events (e.g. OnTextchanged) on ajax calls.
Whatever controls you have in your ASPX file the response is always
javascript code and when you debug you see that an ajax request is
interpreted as a postback, although not everything is posted back.
For that reason, all control related events (of LiveControls) are also being
raised and the response only contains the javascript generated by those
custom controls (e.g. LiveControls).
If I can achieve this it will be very great for me...

Thanks
 
A

AhmetG

Patrice, you are right... UpdatePanel also does (almost) the same thing.
Maybe I was always thinking in a different way.
I'll try to find UpdatePanel's source code...

By the way, according to my observations, UpdatePanel also sends the
ViewState with each Ajax request.
On the other hand, Livecontrols do not send Viewstate. I think they store
viewstate either in Cache or session, which is better of course.

Thanks for your help...

AhmetG
 

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,763
Messages
2,569,562
Members
45,038
Latest member
OrderProperKetocapsules

Latest Threads

Top