Reading a file from within an whatever.aspx.cs

Discussion in 'ASP .Net' started by Zach, May 20, 2012.

  1. Zach

    Zach Guest

    How do I address a file to read from an *.aspx.cs?

    Simply coding "whatever.txt" isn't doing the trick.
    The "whatever.txt" is in with the rest of the classes and stuff costituting
    the one project.

    Zach.
    Zach, May 20, 2012
    #1
    1. Advertising

  2. Zach

    Zach Guest

    "Zach" <> wrote in message
    news:4fb922a3$0$14714$...
    > How do I address a file to read from an *.aspx.cs?
    >
    > Simply coding "whatever.txt" isn't doing the trick.
    > The "whatever.txt" is in with the rest of the classes and stuff
    > costituting the one project.
    >
    > Zach.

    For the sake of clarity, I know how to read from a text file,
    I don't know how to name the source from which to read.
    Zach
    Zach, May 20, 2012
    #2
    1. Advertising

  3. Zach

    Arne Vajhøj Guest

    On 5/20/2012 1:16 PM, Zach wrote:
    > "Zach" <> wrote in message
    > news:4fb922a3$0$14714$...
    >> How do I address a file to read from an *.aspx.cs?
    >>
    >> Simply coding "whatever.txt" isn't doing the trick.
    >> The "whatever.txt" is in with the rest of the classes and stuff
    >> costituting the one project.


    > For the sake of clarity, I know how to read from a text file,
    > I don't know how to name the source from which to read.


    You get the file name from either query parameter or
    form field in the request.

    If you return the file for download you can suggest a
    filename to the browser on a HTTP header.

    Arne
    Arne Vajhøj, May 20, 2012
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. KatB
    Replies:
    0
    Views:
    432
  2. DeathWeasel

    Including an ASPX within an ASPX

    DeathWeasel, May 23, 2007, in forum: .NET
    Replies:
    0
    Views:
    328
    DeathWeasel
    May 23, 2007
  3. S_K
    Replies:
    1
    Views:
    386
    IfThenElse
    Oct 2, 2007
  4. S_K
    Replies:
    0
    Views:
    373
  5. S_K
    Replies:
    0
    Views:
    409
Loading...

Share This Page