error "declaration expected" for (Response.ContentType = "application/pdf")

Discussion in 'ASP .Net' started by TJS, Nov 18, 2003.

  1. TJS

    TJS Guest

    trying to display pdf file in browser
    fails on this line:
    Response.ContentType = "application/pdf"

    getting an error about no declaration found for "response"

    what declaration is needed ???
     
    TJS, Nov 18, 2003
    #1
    1. Advertising

  2. TJS

    Alvin Bruney Guest

    System.Web.HttpContext.Current.Response.Write is it's full name


    --


    -----------
    Got TidBits?
    Get it here: www.networkip.net/tidbits
    "TJS" <> wrote in message
    news:...
    > trying to display pdf file in browser
    > fails on this line:
    > Response.ContentType = "application/pdf"
    >
    > getting an error about no declaration found for "response"
    >
    > what declaration is needed ???
    >
    >
    >
    >
     
    Alvin Bruney, Nov 18, 2003
    #2
    1. Advertising

  3. TJS

    TJS Guest

    I added this

    System.Web.HttpContext.Current.Response.ContentType = "application/pdf"

    but it still throws the same error message


    "Alvin Bruney" <vapordan_spam_me_not@hotmail_no_spamhotmail.com> wrote in
    message news:%...
    > System.Web.HttpContext.Current.Response.Write is it's full name
    >
    >
    > --
    >
    >
    > -----------
    > Got TidBits?
    > Get it here: www.networkip.net/tidbits
    > "TJS" <> wrote in message
    > news:...
    > > trying to display pdf file in browser
    > > fails on this line:
    > > Response.ContentType = "application/pdf"
    > >
    > > getting an error about no declaration found for "response"
    > >
    > > what declaration is needed ???
    > >
    > >
    > >
    > >

    >
    >
     
    TJS, Nov 18, 2003
    #3
  4. TJS

    Alvin Bruney Guest

    That's very wierd to me.
    [snip]
    i copied this into my project
    System.Web.HttpContext.Current.Response.ContentType = "application/pdf";

    and it compiled fine. you have some other error somewhere. comment out that
    line and recompile see what the issue is.


    --


    -----------
    Got TidBits?
    Get it here: www.networkip.net/tidbits
    "TJS" <> wrote in message
    news:...
    > I added this
    >
    > System.Web.HttpContext.Current.Response.ContentType = "application/pdf"
    >
    > but it still throws the same error message
    >
    >
    > "Alvin Bruney" <vapordan_spam_me_not@hotmail_no_spamhotmail.com> wrote in
    > message news:%...
    > > System.Web.HttpContext.Current.Response.Write is it's full name
    > >
    > >
    > > --
    > >
    > >
    > > -----------
    > > Got TidBits?
    > > Get it here: www.networkip.net/tidbits
    > > "TJS" <> wrote in message
    > > news:...
    > > > trying to display pdf file in browser
    > > > fails on this line:
    > > > Response.ContentType = "application/pdf"
    > > >
    > > > getting an error about no declaration found for "response"
    > > >
    > > > what declaration is needed ???
    > > >
    > > >
    > > >
    > > >

    > >
    > >

    >
    >
     
    Alvin Bruney, Nov 18, 2003
    #4
  5. TJS

    TJS Guest

    I rebooted and I have it working now.
    maybe something was cached ???



    "Alvin Bruney" <vapordan_spam_me_not@hotmail_no_spamhotmail.com> wrote in
    message news:%...
    > That's very wierd to me.
    > [snip]
    > i copied this into my project
    > System.Web.HttpContext.Current.Response.ContentType = "application/pdf";
    >
    > and it compiled fine. you have some other error somewhere. comment out

    that
    > line and recompile see what the issue is.
    >
    >
    > --
    >
    >
    > -----------
    > Got TidBits?
    > Get it here: www.networkip.net/tidbits
    > "TJS" <> wrote in message
    > news:...
    > > I added this
    > >
    > > System.Web.HttpContext.Current.Response.ContentType = "application/pdf"
    > >
    > > but it still throws the same error message
    > >
    > >
    > > "Alvin Bruney" <vapordan_spam_me_not@hotmail_no_spamhotmail.com> wrote

    in
    > > message news:%...
    > > > System.Web.HttpContext.Current.Response.Write is it's full name
    > > >
    > > >
    > > > --
    > > >
    > > >
    > > > -----------
    > > > Got TidBits?
    > > > Get it here: www.networkip.net/tidbits
    > > > "TJS" <> wrote in message
    > > > news:...
    > > > > trying to display pdf file in browser
    > > > > fails on this line:
    > > > > Response.ContentType = "application/pdf"
    > > > >
    > > > > getting an error about no declaration found for "response"
    > > > >
    > > > > what declaration is needed ???
    > > > >
    > > > >
    > > > >
    > > > >
    > > >
    > > >

    > >
    > >

    >
    >
     
    TJS, Nov 18, 2003
    #5
  6. TJS

    Alvin Bruney Guest

    No, it was the phase of the moon :)

    --


    -----------
    Got TidBits?
    Get it here: www.networkip.net/tidbits
    "TJS" <> wrote in message
    news:...
    > I rebooted and I have it working now.
    > maybe something was cached ???
    >
    >
    >
    > "Alvin Bruney" <vapordan_spam_me_not@hotmail_no_spamhotmail.com> wrote in
    > message news:%...
    > > That's very wierd to me.
    > > [snip]
    > > i copied this into my project
    > > System.Web.HttpContext.Current.Response.ContentType = "application/pdf";
    > >
    > > and it compiled fine. you have some other error somewhere. comment out

    > that
    > > line and recompile see what the issue is.
    > >
    > >
    > > --
    > >
    > >
    > > -----------
    > > Got TidBits?
    > > Get it here: www.networkip.net/tidbits
    > > "TJS" <> wrote in message
    > > news:...
    > > > I added this
    > > >
    > > > System.Web.HttpContext.Current.Response.ContentType =

    "application/pdf"
    > > >
    > > > but it still throws the same error message
    > > >
    > > >
    > > > "Alvin Bruney" <vapordan_spam_me_not@hotmail_no_spamhotmail.com> wrote

    > in
    > > > message news:%...
    > > > > System.Web.HttpContext.Current.Response.Write is it's full name
    > > > >
    > > > >
    > > > > --
    > > > >
    > > > >
    > > > > -----------
    > > > > Got TidBits?
    > > > > Get it here: www.networkip.net/tidbits
    > > > > "TJS" <> wrote in message
    > > > > news:...
    > > > > > trying to display pdf file in browser
    > > > > > fails on this line:
    > > > > > Response.ContentType = "application/pdf"
    > > > > >
    > > > > > getting an error about no declaration found for "response"
    > > > > >
    > > > > > what declaration is needed ???
    > > > > >
    > > > > >
    > > > > >
    > > > > >
    > > > >
    > > > >
    > > >
    > > >

    > >
    > >

    >
    >
     
    Alvin Bruney, Nov 19, 2003
    #6
    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. Sean Kraft
    Replies:
    0
    Views:
    595
    Sean Kraft
    Jul 6, 2004
  2. David Lozzi
    Replies:
    5
    Views:
    12,434
    Matt Berther
    Jan 14, 2005
  3. Bjorn Sagbakken

    Response.ContentType = "Application/pdf"

    Bjorn Sagbakken, May 29, 2007, in forum: ASP .Net
    Replies:
    4
    Views:
    1,731
    Bjorn Sagbakken
    May 30, 2007
  4. dave
    Replies:
    2
    Views:
    333
    Aaron Bertrand [SQL Server MVP]
    Jul 18, 2005
  5. Katie
    Replies:
    8
    Views:
    268
    Anthony Jones
    Aug 17, 2006
Loading...

Share This Page