How do i load a plaintext file in a aspx website / newbie

  • Thread starter Thread starter david.vantongerloo
  • Start date Start date
D

david.vantongerloo

How do i load a plaintext file in a aspx website / newbie

now i use :
<table>
< iframe src=" text.txt " with="100" heighr="200" >
</table>

Thanks for info.
 
Heres some code. You should be able to load your file, iterate through it
and either response.write the lines of the file out or attach it to a label
(as here), or another control.

StreamReader re = File.OpenText(Server.MapPath("blah.txt"));
string input = null;
string textstuff = null;
while ((input = re.ReadLine()) != null)
{
textstuff += input + "<br>";
}
re.Close();
Label1.Text = textstuff.ToString();

--
Regards

John Timney (MVP)
VISIT MY WEBSITE:
http://www.johntimney.com
http://www.johntimney.com/blog
 
Back
Top