I got a "normal" ascx-Page which contains HTML-Parts as well as code behind. These elements should all be shown in normal conditions (works).
Now I want to be able to set a request-parameter which causes the page zu render differently. Then it sends the information on that page not human-readable but for a machine:
string jsonProperty = Request["JSonProperty"];
if (!string.IsNullOrEmpty(jsonProperty))
{
Response.Clear();
Response.Write(RenderJSon());
// Response.Close();
return;
This code is inside the Page_PreRender. Now my problem is:The string is correctly sent to the browser but the "standard" html-content is still rendered after that.
When I remove the "Response.Close();" Comment I receive an "ERR_INVALID_RESPONSE"
Any clue how to solve this without creating an additional Page?