Showing an HTML file in part of a Webform

  • Thread starter Thread starter Tor Inge Rislaa
  • Start date Start date
T

Tor Inge Rislaa

Showing an HTML file in part of a Webform

Hi I have a Webform with some buttons on the left side of the form. What I
want when clicking one of the buttons is to show an HTML document in a part
of the Webform (as if it was a Frame page). Any suggestions?

(I am an VB programmer)

T.I.Rislaa
 
What you could do is to use a table within an aspx page with 1 row, 2
columns. The first column would contain your buttons, and the second
one would contain a simple Label. When a button is clicked, you set
the text of the label with the html code you want.

In this example DynamicInclude is called when a button is clicked. The
parameter FileName is the name of the html file you want to display.
Note that this html file would not have header or body tags, since
these are already in your .aspx file.

LabelHTML would the label in the second column of the table in your
..aspx page. This kinda act like a frame. Hope this helps!


public string DynamicInclude(string FileName)
{
StreamReader FSO = new StreamReader(Server.MapPath(Filename));

LabelHTML.Text = FSO.ReadToEnd();

FSO.Close();
}
 
Back
Top