0

I want to write a raw html page to the browser. I thought that something liek this would do it but this write to the current page:

Dim html as New StringBuilder
html.append("<html><body>A new html page</body></html>"
Response.Clear()
Response.Output.Write(html.ToString)

I know this can be done I just can't remember how

0

1 Answer 1

1

You have to get the context object and then you can use something like this:

context.Response.Clear();

//Response.Charset = "UTF-8";
context.Response.ContentType = "text/html"

context.Response.AddHeader("Content-Length", length);

context.Response.OutputStream.Write((byte[])buffer, 0, filesize);
Sign up to request clarification or add additional context in comments.

1 Comment

Right, I guess it depends where you call it from. I used it in a handler.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.