473,387 Members | 1,463 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,387 software developers and data experts.

Render HTML text in the Response object

I have a string (or byte array) containing an entire page definition not
contained in a file ("<htm><head>...</head><body>...</body></html>") that I
need to render when the user clicks a button. Can I send this string to the
Reponse object? This "page" is the response.

FYI, this is the content returned by the SQL Reporting Services web service.

--
Paul Turley, MCSD, MCDBA, MCAD, MSF, MCT, Project+, A+
paul@scout-master.(com - remove parentheses)
www.scout-master.com
Nov 18 '05 #1
3 2208
Hi,
Hope you are not making fun.

If you have it as a string or a byte array and need to return it as the
response.
1. You will have to set Response.Buffer = true (so that no response is sent
to the client)
2. After you have the string or the byte array, do a Response.clear( ) to
clear up any stuff
3. Response.ContentType = "text/html"
4. Response.Write(string)
5. Response.fluch( )
6. You can explicitly call Response.End to signal the end of response

Chao for now,

Hermit Dave

"Paul Turley" <paul@createsolutions.(what you use to catch a butterfly)>
wrote in message news:eL**************@tk2msftngp13.phx.gbl...
I have a string (or byte array) containing an entire page definition not
contained in a file ("<htm><head>...</head><body>...</body></html>") that I need to render when the user clicks a button. Can I send this string to the Reponse object? This "page" is the response.

FYI, this is the content returned by the SQL Reporting Services web service.
--
Paul Turley, MCSD, MCDBA, MCAD, MSF, MCT, Project+, A+
paul@scout-master.(com - remove parentheses)
www.scout-master.com

Nov 18 '05 #2
if you have the data in byte[], then use
Response.BinaryWrite(yourDataByteArray)

Regards,

Hermit Dave

"Paul Turley" <paul@createsolutions.(what you use to catch a butterfly)>
wrote in message news:eL**************@tk2msftngp13.phx.gbl...
I have a string (or byte array) containing an entire page definition not
contained in a file ("<htm><head>...</head><body>...</body></html>") that I need to render when the user clicks a button. Can I send this string to the Reponse object? This "page" is the response.

FYI, this is the content returned by the SQL Reporting Services web service.
--
Paul Turley, MCSD, MCDBA, MCAD, MSF, MCT, Project+, A+
paul@scout-master.(com - remove parentheses)
www.scout-master.com

Nov 18 '05 #3
Paul Turley wrote:
I have a string (or byte array) containing an entire page definition not
contained in a file ("<htm><head>...</head><body>...</body></html>") that I
need to render when the user clicks a button. Can I send this string to the
Reponse object? This "page" is the response.

FYI, this is the content returned by the SQL Reporting Services web service.


I find the simplest solution is to override the Render method/event of
the page, and in there write out the string you have (and don't call
your parent class's Render method). So you'll have to pry put the
string in a pageclass-level variable to get it inside Render.

--
Craig Deelsnyder
Microsoft MVP - ASP/ASP.NET

Nov 18 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

6
by: vandalo | last post by:
Hi all I developed a service which can convert an office document (word, excel, powerpoint into HTML and save it on the file system To do this I use the "save as" functions of the office...
6
by: Tarren | last post by:
Hi: I have an aspx page that takes a dataset, makes the datagrid, and displays it. The new thing I have to do is take this same output and send it as an email. Is there an easy way to do...
13
by: Bob Jones | last post by:
Here is my situation: I have an aspx file stored in a resource file. All of the C# code is written inline via <script runat="server"tags. Let's call this page B. I also have page A that contains...
0
by: Jeff | last post by:
hey asp.net 3.5 I have 2 UpdatePanels in my webpage. This webpage has a GridView, which one of its column is a templatefield which again contain a UpdatePanel and a button... The other...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.