By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
445,743 Members | 1,122 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 445,743 IT Pros & Developers. It's quick & easy.

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

P: n/a
TJS
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 ???


Nov 18 '05 #1
Share this Question
Share on Google+
5 Replies


P: n/a
System.Web.HttpContext.Current.Response.Write is it's full name
--
-----------
Got TidBits?
Get it here: www.networkip.net/tidbits
"TJS" <no****@here.com> wrote in message
news:un**************@tk2msftngp13.phx.gbl...
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 ???

Nov 18 '05 #2

P: n/a
TJS
I added this

System.Web.HttpContext.Current.Response.ContentTyp e = "application/pdf"

but it still throws the same error message
"Alvin Bruney" <vapordan_spam_me_not@hotmail_no_spamhotmail.com > wrote in
message news:%2****************@TK2MSFTNGP11.phx.gbl...
System.Web.HttpContext.Current.Response.Write is it's full name
--
-----------
Got TidBits?
Get it here: www.networkip.net/tidbits
"TJS" <no****@here.com> wrote in message
news:un**************@tk2msftngp13.phx.gbl...
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 ???


Nov 18 '05 #3

P: n/a
That's very wierd to me.
[snip]
i copied this into my project
System.Web.HttpContext.Current.Response.ContentTyp e = "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" <no****@here.com> wrote in message
news:uC**************@tk2msftngp13.phx.gbl...
I added this

System.Web.HttpContext.Current.Response.ContentTyp e = "application/pdf"

but it still throws the same error message
"Alvin Bruney" <vapordan_spam_me_not@hotmail_no_spamhotmail.com > wrote in
message news:%2****************@TK2MSFTNGP11.phx.gbl...
System.Web.HttpContext.Current.Response.Write is it's full name
--
-----------
Got TidBits?
Get it here: www.networkip.net/tidbits
"TJS" <no****@here.com> wrote in message
news:un**************@tk2msftngp13.phx.gbl...
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 ???



Nov 18 '05 #4

P: n/a
TJS
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:%2****************@TK2MSFTNGP11.phx.gbl...
That's very wierd to me.
[snip]
i copied this into my project
System.Web.HttpContext.Current.Response.ContentTyp e = "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" <no****@here.com> wrote in message
news:uC**************@tk2msftngp13.phx.gbl...
I added this

System.Web.HttpContext.Current.Response.ContentTyp e = "application/pdf"

but it still throws the same error message
"Alvin Bruney" <vapordan_spam_me_not@hotmail_no_spamhotmail.com > wrote in message news:%2****************@TK2MSFTNGP11.phx.gbl...
System.Web.HttpContext.Current.Response.Write is it's full name
--
-----------
Got TidBits?
Get it here: www.networkip.net/tidbits
"TJS" <no****@here.com> wrote in message
news:un**************@tk2msftngp13.phx.gbl...
> 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 ???
>
>
>
>



Nov 18 '05 #5

P: n/a
No, it was the phase of the moon :-)

--
-----------
Got TidBits?
Get it here: www.networkip.net/tidbits
"TJS" <no****@here.com> wrote in message
news:eM**************@TK2MSFTNGP12.phx.gbl...
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:%2****************@TK2MSFTNGP11.phx.gbl...
That's very wierd to me.
[snip]
i copied this into my project
System.Web.HttpContext.Current.Response.ContentTyp e = "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" <no****@here.com> wrote in message
news:uC**************@tk2msftngp13.phx.gbl...
I added this

System.Web.HttpContext.Current.Response.ContentTyp e = "application/pdf"
but it still throws the same error message
"Alvin Bruney" <vapordan_spam_me_not@hotmail_no_spamhotmail.com > wrote in message news:%2****************@TK2MSFTNGP11.phx.gbl...
> System.Web.HttpContext.Current.Response.Write is it's full name
>
>
> --
>
>
> -----------
> Got TidBits?
> Get it here: www.networkip.net/tidbits
> "TJS" <no****@here.com> wrote in message
> news:un**************@tk2msftngp13.phx.gbl...
> > 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 ???
> >
> >
> >
> >
>
>



Nov 18 '05 #6

This discussion thread is closed

Replies have been disabled for this discussion.