Saturday, March 31, 2012
Set application variable from a class
I am trying to set an application variable from a class file in my website.
Currently, the class file inherits from System.Web.UI.Page
I also referenced all the namespaces a normal webform would.
However, when i try save my application variable like such:
Application["test"] = "hello";
I get the following error:
Object reference not set to an instance of an object
How can i set an application variable from a class
It works fine from a webform
TIA
GrantGot It
HttpContext.Current.Application[ ...
"Grant Merwitz" <grant@.workshare.com> wrote in message
news:%23hZBPQ9NGHA.3984@.TK2MSFTNGP14.phx.gbl...
> Hi
> I am trying to set an application variable from a class file in my
> website.
> Currently, the class file inherits from System.Web.UI.Page
> I also referenced all the namespaces a normal webform would.
> However, when i try save my application variable like such:
> Application["test"] = "hello";
> I get the following error:
> Object reference not set to an instance of an object
> How can i set an application variable from a class
> It works fine from a webform
> TIA
> Grant
>
Set application variable from a class
I am trying to set an application variable from a class file in my website.
Currently, the class file inherits from System.Web.UI.Page
I also referenced all the namespaces a normal webform would.
However, when i try save my application variable like such:
Application["test"] = "hello";
I get the following error:
Object reference not set to an instance of an object
How can i set an application variable from a class
It works fine from a webform
TIA
GrantGot It
HttpContext.Current.Application[ ...
"Grant Merwitz" <grant@.workshare.com> wrote in message
news:%23hZBPQ9NGHA.3984@.TK2MSFTNGP14.phx.gbl...
> Hi
> I am trying to set an application variable from a class file in my
> website.
> Currently, the class file inherits from System.Web.UI.Page
> I also referenced all the namespaces a normal webform would.
> However, when i try save my application variable like such:
> Application["test"] = "hello";
> I get the following error:
> Object reference not set to an instance of an object
> How can i set an application variable from a class
> It works fine from a webform
> TIA
> Grant
Monday, March 26, 2012
Set error level in Visual Studio 2005?
How do I stop these errors from displaying? I only want serious errors, I can't seem to find how to do it in the options, and help doesnt offer any suggestions either.
ThanksLook for the page's TargetSchema property.
Is there not something I can set at the application level? I have like 300 pages in my project...
Best you can do: They are warnings, ignore them.
Thing is, the 'serious' errors will prevent the application from compiling anyways. You'll see them with the exclamation mark next to them.
Set flash src property to an aspx page?
aspx page. We do this because we can't (for security purposes) have
the images in a publicly accessible area that can be referenced
directly via a browser. So, the src of our image tags goes something
like "src=GetFile.aspx?id=1234". I want to do the same thing
with .SWF files, but wanted to know if the flash plug-in would accept
a file for its source that wasn't an .SWF file. Any help would be
much appreciated.
Thanks!Yes. Since you are indeed feeding it an SWF file (albeit with a different
file extension) it should work.
Here's more info:
http://SteveOrr.net/articles/Flasher.aspx
I hope this helps,
Steve C. Orr,
MCSD, MVP, CSM, ASPInsider
http://SteveOrr.net
<noneya22@.excite.com> wrote in message
news:1178573709.215168.273760@.y80g2000hsf.googlegroups.com...
> We have a website that displays images by way of a general purpose
> aspx page. We do this because we can't (for security purposes) have
> the images in a publicly accessible area that can be referenced
> directly via a browser. So, the src of our image tags goes something
> like "src=GetFile.aspx?id=1234". I want to do the same thing
> with .SWF files, but wanted to know if the flash plug-in would accept
> a file for its source that wasn't an .SWF file. Any help would be
> much appreciated.
> Thanks!
>