テキスト ファイルの内容を表に表示しようとしています。テキストファイルを正常に読み取り、.txt
ファイルの内容をdivに表示することはできましたが、内容をテーブルに表示しようとするとエラーがスローされます。
私は何か間違ったことをしていますか?
これが私のコードビハインドです:
protected void btnUpld_Click(object sender, EventArgs e)
{
Stream theStream = file1.PostedFile.InputStream;
//file1 is an asp:FileUpload on .aspx
using (StreamReader viewer = new
StreamReader((Stream)file1.PostedFile.InputStream))
{
while (viewer.Peek() > 0)
{
string txtskip = viewer.ReadLine();
Table1.InnerHtml += txtskip;
//Table1 is the table i'm wanting to put the results in on my .aspx
}
}
}