Showing posts with label builds. Show all posts
Showing posts with label builds. Show all posts

Thursday, March 29, 2012

Object persistence

Hello,
I have a page (page1.aspx) that builds some complex .NET objects.
I successfully pass these objects to another different window (page2.aspx).
How can I persist these objects on a POST back of the same window
(page2.aspx)?
Thank you
MarcelMarcel Balcarek wrote:

> Hello,
> I have a page (page1.aspx) that builds some complex .NET objects.
> I successfully pass these objects to another different window (page2.aspx)
.
> How can I persist these objects on a POST back of the same window
> (page2.aspx)?
> Thank you
> Marcel
>
You can use the session object to store them, or you even better you can
store them in view state of the page itself, so that you dont have to
worry about server resources and stuff ..
Hi Marcel,
Static variables, Session variable, Application variable, Viewstate.
Jim Cheshire, MCSE, MCSD [MSFT]
ASP.NET
Developer Support
jamesche@.online.microsoft.com
This post is provided "AS-IS" with no warranties and confers no rights.
--
>From: "Marcel Balcarek" <marcel_balcarek@.REM-OVEMEtoxicall.com>
>Subject: Object persistence
>Date: Thu, 15 Apr 2004 10:34:00 -0600
>Lines: 11
>X-Priority: 3
>X-MSMail-Priority: Normal
>X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
>X-MIMEOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
>Message-ID: <u7IlFfwIEHA.3060@.TK2MSFTNGP11.phx.gbl>
>Newsgroups: microsoft.public.dotnet.framework.aspnet
>NNTP-Posting-Host: c-67-165-238-210.client.comcast.net 67.165.238.210
>Path: cpmsftngxa06.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFTNGP11.phx.gbl
>Xref: cpmsftngxa06.phx.gbl microsoft.public.dotnet.framework.aspnet:225884
>X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet
>Hello,
>I have a page (page1.aspx) that builds some complex .NET objects.
>I successfully pass these objects to another different window (page2.aspx).
>How can I persist these objects on a POST back of the same window
>(page2.aspx)?
>Thank you
>Marcel
>
>
Hi Jim,
Thanks for the info. Due to the size of the objects I am persisting, and
the low bandwidth some of my customers enjoy, I have decided to serialize
my objects and use the binaryFormatter, and then store them as byte arrays
in a general DB table that has an image column.
I discounted viewstate because of its sheer size (network traffic) - I
tested viewstate with a tiny object (2 Int32s) and it added about 3 lines to
my HTML output.
I discounted session variables because that solution is not scalable for
large amounts of data.
Other than initial setup effort, my solution should be ok no?
Marcel
"Jim Cheshire [MSFT]" <jamesche@.online.microsoft.com> wrote in message
news:JpIBY78IEHA.2644@.cpmsftngxa06.phx.gbl...
> Hi Marcel,
> Static variables, Session variable, Application variable, Viewstate.
> Jim Cheshire, MCSE, MCSD [MSFT]
> ASP.NET
> Developer Support
> jamesche@.online.microsoft.com
> This post is provided "AS-IS" with no warranties and confers no rights.
>
> --
microsoft.public.dotnet.framework.aspnet:225884
(page2.aspx).
>
Hi Marcel,
That should work fine. It's worth mentioning that if you are not making
heavy use of Session state otherwise, you can use SqlServer Session state
and make this process automatic and much easier to implement. Bear in mind
that if you ARE making heavy use of Session state elsewhere in your app,
you will see performance degradation if you move from InProc to SqlServer
mode for Session state.
Jim Cheshire, MCSE, MCSD [MSFT]
ASP.NET
Developer Support
jamesche@.online.microsoft.com
This post is provided "AS-IS" with no warranties and confers no rights.
--
>From: "Marcel" <marcelbalcarek@.REMOVEMEmsn.com>
>References: <u7IlFfwIEHA.3060@.TK2MSFTNGP11.phx.gbl>
<JpIBY78IEHA.2644@.cpmsftngxa06.phx.gbl>
>Subject: Re: Object persistence
>Date: Sat, 17 Apr 2004 14:43:23 -0600
>Lines: 66
>X-Priority: 3
>X-MSMail-Priority: Normal
>X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
>X-MIMEOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
>Message-ID: <OcJ2OyLJEHA.1388@.TK2MSFTNGP09.phx.gbl>
>Newsgroups: microsoft.public.dotnet.framework.aspnet
>NNTP-Posting-Host: 168-103-77-32.dnvr.qwest.net 168.103.77.32
>Path:
cpmsftngxa10.phx.gbl!TK2MSFTFEED01.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFTNGP09
.phx.gbl
>Xref: cpmsftngxa10.phx.gbl microsoft.public.dotnet.framework.aspnet:227215
>X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet
>Hi Jim,
>Thanks for the info. Due to the size of the objects I am persisting, and
>the low bandwidth some of my customers enjoy, I have decided to serialize
>my objects and use the binaryFormatter, and then store them as byte arrays
>in a general DB table that has an image column.
>I discounted viewstate because of its sheer size (network traffic) - I
>tested viewstate with a tiny object (2 Int32s) and it added about 3 lines
to
>my HTML output.
>I discounted session variables because that solution is not scalable for
>large amounts of data.
>Other than initial setup effort, my solution should be ok no?
>Marcel
>
>"Jim Cheshire [MSFT]" <jamesche@.online.microsoft.com> wrote in message
>news:JpIBY78IEHA.2644@.cpmsftngxa06.phx.gbl...
>microsoft.public.dotnet.framework.aspnet:225884
>(page2.aspx).
>
>

Object persistence

Hello,

I have a page (page1.aspx) that builds some complex .NET objects.
I successfully pass these objects to another different window (page2.aspx).
How can I persist these objects on a POST back of the same window
(page2.aspx)?

Thank you
MarcelMarcel Balcarek wrote:

> Hello,
> I have a page (page1.aspx) that builds some complex .NET objects.
> I successfully pass these objects to another different window (page2.aspx).
> How can I persist these objects on a POST back of the same window
> (page2.aspx)?
> Thank you
> Marcel
>
You can use the session object to store them, or you even better you can
store them in view state of the page itself, so that you dont have to
worry about server resources and stuff ..
Hi Marcel,

Static variables, Session variable, Application variable, Viewstate.

Jim Cheshire, MCSE, MCSD [MSFT]
ASP.NET
Developer Support
jamesche@.online.microsoft.com

This post is provided "AS-IS" with no warranties and confers no rights.

-------
>From: "Marcel Balcarek" <marcel_balcarek@.REM-OVEMEtoxicall.com>
>Subject: Object persistence
>Date: Thu, 15 Apr 2004 10:34:00 -0600
>Lines: 11
>X-Priority: 3
>X-MSMail-Priority: Normal
>X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
>X-MIMEOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
>Message-ID: <u7IlFfwIEHA.3060@.TK2MSFTNGP11.phx.gbl>
>Newsgroups: microsoft.public.dotnet.framework.aspnet
>NNTP-Posting-Host: c-67-165-238-210.client.comcast.net 67.165.238.210
>Path: cpmsftngxa06.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFTN GP11.phx.gbl
>Xref: cpmsftngxa06.phx.gbl microsoft.public.dotnet.framework.aspnet:225884
>X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet
>Hello,
>I have a page (page1.aspx) that builds some complex .NET objects.
>I successfully pass these objects to another different window (page2.aspx).
>How can I persist these objects on a POST back of the same window
>(page2.aspx)?
>Thank you
>Marcel
Hi Jim,

Thanks for the info. Due to the size of the objects I am persisting, and
the low bandwidth some of my customers enjoy, I have decided to serialize
my objects and use the binaryFormatter, and then store them as byte arrays
in a general DB table that has an image column.

I discounted viewstate because of its sheer size (network traffic) - I
tested viewstate with a tiny object (2 Int32s) and it added about 3 lines to
my HTML output.
I discounted session variables because that solution is not scalable for
large amounts of data.

Other than initial setup effort, my solution should be ok no?

Marcel

"Jim Cheshire [MSFT]" <jamesche@.online.microsoft.com> wrote in message
news:JpIBY78IEHA.2644@.cpmsftngxa06.phx.gbl...
> Hi Marcel,
> Static variables, Session variable, Application variable, Viewstate.
> Jim Cheshire, MCSE, MCSD [MSFT]
> ASP.NET
> Developer Support
> jamesche@.online.microsoft.com
> This post is provided "AS-IS" with no warranties and confers no rights.
>
> -------
> >From: "Marcel Balcarek" <marcel_balcarek@.REM-OVEMEtoxicall.com>
> >Subject: Object persistence
> >Date: Thu, 15 Apr 2004 10:34:00 -0600
> >Lines: 11
> >X-Priority: 3
> >X-MSMail-Priority: Normal
> >X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
> >X-MIMEOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
> >Message-ID: <u7IlFfwIEHA.3060@.TK2MSFTNGP11.phx.gbl>
> >Newsgroups: microsoft.public.dotnet.framework.aspnet
> >NNTP-Posting-Host: c-67-165-238-210.client.comcast.net 67.165.238.210
> >Path: cpmsftngxa06.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFTN GP11.phx.gbl
> >Xref: cpmsftngxa06.phx.gbl
microsoft.public.dotnet.framework.aspnet:225884
> >X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet
> >Hello,
> >I have a page (page1.aspx) that builds some complex .NET objects.
> >I successfully pass these objects to another different window
(page2.aspx).
> >How can I persist these objects on a POST back of the same window
> >(page2.aspx)?
> >Thank you
> >Marcel
Hi Marcel,

That should work fine. It's worth mentioning that if you are not making
heavy use of Session state otherwise, you can use SqlServer Session state
and make this process automatic and much easier to implement. Bear in mind
that if you ARE making heavy use of Session state elsewhere in your app,
you will see performance degradation if you move from InProc to SqlServer
mode for Session state.

Jim Cheshire, MCSE, MCSD [MSFT]
ASP.NET
Developer Support
jamesche@.online.microsoft.com

This post is provided "AS-IS" with no warranties and confers no rights.

-------
>From: "Marcel" <marcelbalcarek@.REMOVEMEmsn.com>
>References: <u7IlFfwIEHA.3060@.TK2MSFTNGP11.phx.gbl>
<JpIBY78IEHA.2644@.cpmsftngxa06.phx.gbl>
>Subject: Re: Object persistence
>Date: Sat, 17 Apr 2004 14:43:23 -0600
>Lines: 66
>X-Priority: 3
>X-MSMail-Priority: Normal
>X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
>X-MIMEOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
>Message-ID: <OcJ2OyLJEHA.1388@.TK2MSFTNGP09.phx.gbl>
>Newsgroups: microsoft.public.dotnet.framework.aspnet
>NNTP-Posting-Host: 168-103-77-32.dnvr.qwest.net 168.103.77.32
>Path:
cpmsftngxa10.phx.gbl!TK2MSFTFEED01.phx.gbl!TK2MSFT NGP08.phx.gbl!TK2MSFTNGP09
.phx.gbl
>Xref: cpmsftngxa10.phx.gbl microsoft.public.dotnet.framework.aspnet:227215
>X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet
>Hi Jim,
>Thanks for the info. Due to the size of the objects I am persisting, and
>the low bandwidth some of my customers enjoy, I have decided to serialize
>my objects and use the binaryFormatter, and then store them as byte arrays
>in a general DB table that has an image column.
>I discounted viewstate because of its sheer size (network traffic) - I
>tested viewstate with a tiny object (2 Int32s) and it added about 3 lines
to
>my HTML output.
>I discounted session variables because that solution is not scalable for
>large amounts of data.
>Other than initial setup effort, my solution should be ok no?
>Marcel
>
>"Jim Cheshire [MSFT]" <jamesche@.online.microsoft.com> wrote in message
>news:JpIBY78IEHA.2644@.cpmsftngxa06.phx.gbl...
>> Hi Marcel,
>>
>> Static variables, Session variable, Application variable, Viewstate.
>>
>> Jim Cheshire, MCSE, MCSD [MSFT]
>> ASP.NET
>> Developer Support
>> jamesche@.online.microsoft.com
>>
>> This post is provided "AS-IS" with no warranties and confers no rights.
>>
>>
>> -------
>> >From: "Marcel Balcarek" <marcel_balcarek@.REM-OVEMEtoxicall.com>
>> >Subject: Object persistence
>> >Date: Thu, 15 Apr 2004 10:34:00 -0600
>> >Lines: 11
>> >X-Priority: 3
>> >X-MSMail-Priority: Normal
>> >X-Newsreader: Microsoft Outlook Express 6.00.2800.1158
>> >X-MIMEOLE: Produced By Microsoft MimeOLE V6.00.2800.1165
>> >Message-ID: <u7IlFfwIEHA.3060@.TK2MSFTNGP11.phx.gbl>
>> >Newsgroups: microsoft.public.dotnet.framework.aspnet
>> >NNTP-Posting-Host: c-67-165-238-210.client.comcast.net 67.165.238.210
>> >Path: cpmsftngxa06.phx.gbl!TK2MSFTNGP08.phx.gbl!TK2MSFTN GP11.phx.gbl
>> >Xref: cpmsftngxa06.phx.gbl
>microsoft.public.dotnet.framework.aspnet:225884
>> >X-Tomcat-NG: microsoft.public.dotnet.framework.aspnet
>>> >Hello,
>>> >I have a page (page1.aspx) that builds some complex .NET objects.
>> >I successfully pass these objects to another different window
>(page2.aspx).
>> >How can I persist these objects on a POST back of the same window
>> >(page2.aspx)?
>>> >Thank you
>> >Marcel
>>>>>

Thursday, March 22, 2012

Object reference not set to an instance of an object when attempting to view published web

Hi,

I have been developing an asp web site in VS2005, which builds and runs fine from the development environment. However when i publish it to a local test directory (Inetpub/wwwroot/TFL1617) and attempt to view it i get the above error and the following:

Source Error:

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.


Stack Trace:

[NullReferenceException: Object reference not set to an instance of an object.]
System.Web.Hosting.ISAPIWorkerRequestInProc.GetServerVariable(String name) +1841
System.Web.Hosting.ISAPIWorkerRequest.ReadRequestHeaders() +121
System.Web.Hosting.ISAPIWorkerRequest.GetKnownRequestHeader(Int32 index) +126
System.Web.Hosting.ISAPIWorkerRequestInProc.GetKnownRequestHeader(Int32 index) +104
System.Web.HttpRequest.FillInHeadersCollection() +30
System.Web.HttpRequest.get_Headers() +70
System.Web.TraceContext.InitRequest() +603
System.Web.TraceContext.VerifyStart() +170
System.Web.HttpApplication.System.Web.IHttpAsyncHandler.BeginProcessRequest(HttpContext context, AsyncCallback cb, Object extraData) +3445423
System.Web.HttpRuntime.ProcessRequestInternal(HttpWorkerRequest wr) +300


Version Information: Microsoft .NET Framework Version:2.0.50727.42; ASP.NET Version:2.0.50727.42

IIS is version 5.1

Has anyone got any idea what the problem might be or how i can find out a little more about it?

Thanks

Can you give a code snippet and show where the error is occuring?

Thats the problem. I have no idea where it is occuring. It is the message i get when i try to load any web page from the site, not when i try to run a task using a control. I have also tried loading a blank test page with no controls / code associated with it (though it might have been an error with a custom control, it returns the same thing. So i'm thinking it must be some sort of IIS setup problem . . . any ideas?

Thanks


Do you have your local computer configured for ASP.NET 2.0?

Thanks for your suggestion but yes, i believe I do. In IIS i have both the 'Default Web Sites' and specific application nodes set to asp v2.0 via 'properties' -> 'asp.net' tab.


I have just attempted to publish a simple web site. I consists of only a Default.aspx page, which contains a single label control. I get a similar error, but slightly different stack trace:

Stack Trace:

[NullReferenceException: Object reference not set to an instance of an object.]
System.Web.Hosting.ISAPIWorkerRequestInProc.GetServerVariable(String name) +1618
System.Web.Security.WindowsAuthenticationModule.OnEnter(Object source, EventArgs eventArgs) +593
System.Web.SyncEventExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +92
System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +64

So presumably it must be an IIS configuration issue as it is using a clean web.config. Any thoughts on a resolution?

Thanks again.


It may in fact be a framework issue. Simple .htm & .asp files load ok through IIS, the problem is with .aspx files??

Can anyone suggest anything?


Thanks.


After many high speed collisions between my head and a brick wall, all i needed to do was register the ASP.NET extensions in IIS, as i had installed IIS after the .NET framework. Simply go to command window and run aspnet_regiis -i (The -i option installs the needed associations in IIS) in the WINDOWS\Microsoft.NET\Framework\vX.X.XXXX directory.

I hope this may help someone. :)


It did. I just configured my new laptop and had forgotten this step. :) Thanks


Just helped me :-)Thx!