open a text file or word document in the asp.net page
ASP.NET
2
Posts
2
Posters
0
Views
1
Watching
-
hai.. i need to open a text file or word document in my web page if i click on one button ...hw can i do that ...plz help me out..
You can use file management classes. 1-
StreamReader
, used for reading 2-StreamWriter
, used for writing To open a text file and showing it's content, first you need to map the file usingServer.MapPath()
. Give the mapped file name toStreamReader
object and userReadToEnd()
method. Assign the content to a Lable/Literal control. You are almost done