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

  • Thread starter Thread starter TJS
  • Start date Start date
T

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 ???
 
I added this

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

but it still throws the same error message
 
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.
 
I rebooted and I have it working now.
maybe something was cached ???



Alvin Bruney said:
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 said:
I added this

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

but it still throws the same error message


message news:%[email protected]...
 
No, it was the phase of the moon :-)

--


-----------
Got TidBits?
Get it here: www.networkip.net/tidbits
TJS said:
I rebooted and I have it working now.
maybe something was cached ???



Alvin Bruney said:
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 said:
I added this

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

but it still throws the same error message


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


--


-----------
Got TidBits?
Get it here: www.networkip.net/tidbits
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 ???
 
Back
Top