473,395 Members | 1,941 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,395 software developers and data experts.

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

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
5 4931
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
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
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
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
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: theroo | last post by:
Hi there, I am driving myself crazy over this problem. I have used this very same function in another page without any problems, but now I am experiencing the "Error: Expected ';'" when i try...
10
by: Kobu | last post by:
My question is about the use and meaning of the terms "declaration" and "definition" as it pertains to the C language. I've read sources that mix the two up when talking about such things as...
8
by: gh0st54 | last post by:
Hi I'm trying to post to Paypal to process payment I try a server.tranfer but I get the error : "System.ArgumentException: Invalid path for child request...
3
by: rdi | last post by:
The import statements weren't copy/pasted, but everything INSIDE the class WAS copy pasted from the help file. Starting with the myMail.From line and going down to the SmtpMail.Send line, EVERY line...
1
by: STAGED | last post by:
The script: proc bugsy { } { global helmet pack forget .widget1 if { $helmet(key1) } { pack .widget2 -anchor nw -side top -expand 0 } else { show_new_widget }
3
by: wwwursa | last post by:
I am trying to use the Right function in a VB6 program. I have used it used many times before in other programs. When I press the enter key after entering the code line, the word "Right" turns...
6
by: Lawrence Spector | last post by:
I ran into a problem using g++. Visual Studio 2005 never complained about this, but with g++ I ran into this error. I can't figure out if I've done something wrong or if this is a compiler bug. ...
1
by: jmvidalvia | last post by:
Hi! My second post, very similar to the first one. I just mounted a debian server and start to run some few scripts. They "seem" to run, but sometimes (5% of times) I am getting this error message:...
9
by: Rohit | last post by:
I am trying to initialize an array whose initializers depend on value of Enums. I take enum and then decide the initializer value, so that even if enum value changes because of addition to list...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.