Display an HTML object referred to by SQL Server

P

Paul

how can I display an HTML document that has been referred to by a SQL
address? For example, I have a HTML doc called WoofInfo.htm. In a column
in my SQL Server, I have the address a ~/Info/WoofInfo.htm. How can I get
an ASP.Net page to display the contents of the HTML file?

TIA,

Paul
 
E

Eliyahu Goldin

Paul,

There is a number of options. How do you want to render the file? To replace
the current page in the same window? In a separate frame? In a popup window?

Eliyahu
 
P

Paul

Thanks.
I would like to have functionality similar to an asp.net label. I have a
FormView with other information, and would like to have it displayed in an
area like a label control (that just displays now the path).

Paolo
 
E

Eliyahu Goldin

I can use an asp.net label. Just read the file content into a string and
assign it to the label's Text property.

Eliyahu
 
P

Paul

Thanks. Can you please show how?

Paul

Eliyahu Goldin said:
I can use an asp.net label. Just read the file content into a string and
assign it to the label's Text property.

Eliyahu
 
E

Eliyahu Goldin

string fileName = MapPath(theUrlFromDatabase);
System.IO.StreamReader sr = new System.IO.StreamReader (fileName);
string htmlFromFile = sr.readToEnd();
myLabel.Text = htmlFromFile;

Eliyahu
 

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

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top