want to read content of .txt file into webform or webpage

Last post 05-16-2008 8:49 PM by eopeter. 2 replies.

Sort Posts:

  • want to read content of .txt file into webform or webpage

    05-16-2008, 5:40 PM
    • Loading...
    • maxmax
    • Joined on 06-06-2007, 3:39 AM
    • DotNet
    • Posts 361

    I am developing asp.net web applications.

    I have .txt file on my server and I want to read contents of .txt file into my .aspx page ( note: I dont want to read context of my .txt file into textbox) 

    i know that i can export .txt file using Response.ContentType = "application/txt" kind of stuff

    help me out

    thank u

    maxmax

  • Re: want to read content of .txt file into webform or webpage

    05-16-2008, 7:41 PM
    • Loading...
    • gunteman
    • Joined on 07-11-2007, 12:57 PM
    • Norrköping, Sweden
    • Posts 2,194

     Assign the string to a Literal control, instead of a textbox.

    -- "Mark As Answer" if my reply helped you --
  • Re: want to read content of .txt file into webform or webpage

    05-16-2008, 8:49 PM
    Answer
    • Loading...
    • eopeter
    • Joined on 02-09-2007, 4:55 PM
    • Posts 6

    you could put a label on your site for example.

     while(SR.peek() != -1){

    Label1.Text += SW.Readline();

    }

Page 1 of 1 (3 items)