Ask a Question related to ASP.NET General, Design and Development.
-
Dean #1
SessionState won't work
I have notice a couple of other threads here that depict the same problem I
am having: I can't get session state to work.
I wrote a component class to do all of my database access and use it in both
Windows .net and ASP.net applications. I was dealing with it in a single
aspx page (using codebehind) where it worked fine for this particular app.
Now I have the instantiation in global.asax in the session_start:
dim myDBProc as PhotoDBProcs = new PhotoDBProcs(...connection string )
In one of the pages that uses this I have:
dim myDBProc = ctype(Session("myDBProc"), PhotoDBProcs)
But this gets flagged with an error saying that session state can only be
used when enablesessionstate is set to true. I do have it set to true on
this page as follows:
<%@ Page Language="vb" EnableSessionState="true" AutoEventWireup="false"
Codebehind="WebForm1.aspx.vb" Inherits="DBAPhotoQuery.WebForm1"%>
Also my web.config file says:
<sessionState
mode="InProc"
stateConnectionString="tcpip=127.0.0.1:42424"
sqlConnectionString="data
source=127.0.0.1;Trusted_Connection=yes"
cookieless="false"
timeout="20"
/>
Any idea why this is not working
thanks,
Dean
Dean Guest
-
WebService session sessionstate SOAP
*Please* help --- I'm tearing my hair out. I want to use sessionstate in a webservice, accessed from a client, written in script (JScript,... -
Links don't work in Shockwave movie but work in p
Hi, everyone: I encountered a strange problem. I downloaded a sample movie from Macromedia site and noticed that the same problem occurs what I had... -
Using Web.Config sessionState values
Ok, I think I have been barking up the wrong tree here. I think my question should have been:- Can you point an <appSettings> key to the registry... -
Session Expired (sessionState mode="SQLServer")
Hi All, We have developmented Web project with ASP.Net and SQL server Database. In this project we have configured "SessionState" mode as... -
Where does IIS and ASP.Net save Authentication info? (sessionState mode="SQLServer")
Hi, I've successfully setup my machine to use: sessionState mode="SQLServer". All is up and running so no problems so far. Because I curious... -
Dean #2
Re: SessionState won't work
I put that second line in my session_start as you advised that says:
Session("myDBProc") = myDBProc
and I still get exactly the same error. Since I have seen this problem
posted before and also noticed than noone has been able to find a solution,
I suspect that maybe this is a bug in asp.net?
Trying something simpler I put the following into session_start:
dim sessioninteger as integer = 4
and tried to retrieve it from my aspx page - it came through as zero
Then,
I used your suggestion to follow that definition with:
session("sessioninteger") = sessioninteger
and it came through as 4, as it should.
(by the way, i don't see your suggestion in any docs or books - is this an
undocumented solution?)
so, it seems that it will work with simple value types but not with
something more complex.
Not sure I know where to go from here,
Dean
"S. Justin Gengo" <sjgengo@aboutfortunate.com> wrote in message
news:e5MWwMfWDHA.2268@TK2MSFTNGP11.phx.gbl...problem> Even in the global.asax you still need to place the connection into the
> session variable.
>
> Change your code to include setting the session variable and it will work:
>
> Now I have the instantiation in global.asax in the session_start:
> dim myDBProc as PhotoDBProcs = new PhotoDBProcs(...connection string )
> Session("myDBProc") = myDBProc
>
> Sincerely,
>
> --
> S. Justin Gengo, MCP
> Web Developer
>
> Free code library at:
> [url]www.aboutfortunate.com[/url]
>
> "Out of chaos comes order."
> Nietzche
> "Dean" <deanblakely@earthlink.net> wrote in message
> news:%23L4s8weWDHA.1580@tk2msftngp13.phx.gbl...> > I have notice a couple of other threads here that depict the samesingle> I> both> > am having: I can't get session state to work.
> >
> > I wrote a component class to do all of my database access and use it in> > Windows .net and ASP.net applications. I was dealing with it in aapp.> > aspx page (using codebehind) where it worked fine for this particularbe> ring )> >
> > Now I have the instantiation in global.asax in the session_start:
> > dim myDBProc as PhotoDBProcs = new PhotoDBProcs(...connection> >
> > In one of the pages that uses this I have:
> > dim myDBProc = ctype(Session("myDBProc"), PhotoDBProcs)
> >
> > But this gets flagged with an error saying that session state can onlyon> > used when enablesessionstate is set to true. I do have it set to true>> > this page as follows:
> > <%@ Page Language="vb" EnableSessionState="true" AutoEventWireup="false"
> > Codebehind="WebForm1.aspx.vb" Inherits="DBAPhotoQuery.WebForm1"%>
> >
> > Also my web.config file says:
> > <sessionState
> > mode="InProc"
> > stateConnectionString="tcpip=127.0.0.1:42424"
> > sqlConnectionString="data
> > source=127.0.0.1;Trusted_Connection=yes"
> > cookieless="false"
> > timeout="20"
> > />
> > Any idea why this is not working
> > thanks,
> > Dean
> >
> >
>
Dean Guest
-
Dean #3
Re: SessionState won't work
Ah, sorry for the last message, I got it to work as you suggested.
In the aspx pages where I use myDBProcs, of course I had to put:
dim myDBProc as PhotoDBProcs
and then I had to put the following in the Initializecomponent() routine:
myDBProc = CType(Session("myDBProc"), PhotoDBProcs)
Before I was just doing a
Dim myDBProc = CType(Session("myDBProc"), PhotoDBProcs)
Thanks so much for your help, it is working ok now.
Dean
"S. Justin Gengo" <sjgengo@aboutfortunate.com> wrote in message
news:e5MWwMfWDHA.2268@TK2MSFTNGP11.phx.gbl...problem> Even in the global.asax you still need to place the connection into the
> session variable.
>
> Change your code to include setting the session variable and it will work:
>
> Now I have the instantiation in global.asax in the session_start:
> dim myDBProc as PhotoDBProcs = new PhotoDBProcs(...connection string )
> Session("myDBProc") = myDBProc
>
> Sincerely,
>
> --
> S. Justin Gengo, MCP
> Web Developer
>
> Free code library at:
> [url]www.aboutfortunate.com[/url]
>
> "Out of chaos comes order."
> Nietzche
> "Dean" <deanblakely@earthlink.net> wrote in message
> news:%23L4s8weWDHA.1580@tk2msftngp13.phx.gbl...> > I have notice a couple of other threads here that depict the samesingle> I> both> > am having: I can't get session state to work.
> >
> > I wrote a component class to do all of my database access and use it in> > Windows .net and ASP.net applications. I was dealing with it in aapp.> > aspx page (using codebehind) where it worked fine for this particularbe> ring )> >
> > Now I have the instantiation in global.asax in the session_start:
> > dim myDBProc as PhotoDBProcs = new PhotoDBProcs(...connection> >
> > In one of the pages that uses this I have:
> > dim myDBProc = ctype(Session("myDBProc"), PhotoDBProcs)
> >
> > But this gets flagged with an error saying that session state can onlyon> > used when enablesessionstate is set to true. I do have it set to true>> > this page as follows:
> > <%@ Page Language="vb" EnableSessionState="true" AutoEventWireup="false"
> > Codebehind="WebForm1.aspx.vb" Inherits="DBAPhotoQuery.WebForm1"%>
> >
> > Also my web.config file says:
> > <sessionState
> > mode="InProc"
> > stateConnectionString="tcpip=127.0.0.1:42424"
> > sqlConnectionString="data
> > source=127.0.0.1;Trusted_Connection=yes"
> > cookieless="false"
> > timeout="20"
> > />
> > Any idea why this is not working
> > thanks,
> > Dean
> >
> >
>
Dean Guest
-
Jerry #4
Re: SessionState won't work
Is your object PhotoDBProcs serializable?
"Dean" <deanblakely@earthlink.net> wrote in message
news:#L4s8weWDHA.1580@tk2msftngp13.phx.gbl...I> I have notice a couple of other threads here that depict the same problemboth> am having: I can't get session state to work.
>
> I wrote a component class to do all of my database access and use it inring )> Windows .net and ASP.net applications. I was dealing with it in a single
> aspx page (using codebehind) where it worked fine for this particular app.
>
> Now I have the instantiation in global.asax in the session_start:
> dim myDBProc as PhotoDBProcs = new PhotoDBProcs(...connection>
> In one of the pages that uses this I have:
> dim myDBProc = ctype(Session("myDBProc"), PhotoDBProcs)
>
> But this gets flagged with an error saying that session state can only be
> used when enablesessionstate is set to true. I do have it set to true on
> this page as follows:
> <%@ Page Language="vb" EnableSessionState="true" AutoEventWireup="false"
> Codebehind="WebForm1.aspx.vb" Inherits="DBAPhotoQuery.WebForm1"%>
>
> Also my web.config file says:
> <sessionState
> mode="InProc"
> stateConnectionString="tcpip=127.0.0.1:42424"
> sqlConnectionString="data
> source=127.0.0.1;Trusted_Connection=yes"
> cookieless="false"
> timeout="20"
> />
> Any idea why this is not working
> thanks,
> Dean
>
>
Jerry Guest
-
Natty Gur #5
Re: SessionState won't work
If the object is in the local session storage he won’t be serialized.
Natty Gur, CTO
Dao2Com Ltd.
34th Elkalay st. Raanana
Israel , 43000
Phone Numbers:
Office: +972-(0)9-7740261
Fax: +972-(0)9-7740261
Mobile: +972-(0)58-888377
*** Sent via Developersdex [url]http://www.developersdex.com[/url] ***
Don't just participate in USENET...get rewarded for it!
Natty Gur Guest
-
Dean #6
Re: SessionState won't work
No, It is my understanding that serializable is only needed for
out-of-process state. In-proc should be ok for this app. Is my
understanding correct?
Dean
"Jerry" <JGAO2183@rogers.com> wrote in message
news:iYhXa.69198$hOa.10472@news02.bloor.is.net.cab le.rogers.com...problem> Is your object PhotoDBProcs serializable?
>
> "Dean" <deanblakely@earthlink.net> wrote in message
> news:#L4s8weWDHA.1580@tk2msftngp13.phx.gbl...> > I have notice a couple of other threads here that depict the samesingle> I> both> > am having: I can't get session state to work.
> >
> > I wrote a component class to do all of my database access and use it in> > Windows .net and ASP.net applications. I was dealing with it in aapp.> > aspx page (using codebehind) where it worked fine for this particularbe> ring )> >
> > Now I have the instantiation in global.asax in the session_start:
> > dim myDBProc as PhotoDBProcs = new PhotoDBProcs(...connection> >
> > In one of the pages that uses this I have:
> > dim myDBProc = ctype(Session("myDBProc"), PhotoDBProcs)
> >
> > But this gets flagged with an error saying that session state can onlyon> > used when enablesessionstate is set to true. I do have it set to true>> > this page as follows:
> > <%@ Page Language="vb" EnableSessionState="true" AutoEventWireup="false"
> > Codebehind="WebForm1.aspx.vb" Inherits="DBAPhotoQuery.WebForm1"%>
> >
> > Also my web.config file says:
> > <sessionState
> > mode="InProc"
> > stateConnectionString="tcpip=127.0.0.1:42424"
> > sqlConnectionString="data
> > source=127.0.0.1;Trusted_Connection=yes"
> > cookieless="false"
> > timeout="20"
> > />
> > Any idea why this is not working
> > thanks,
> > Dean
> >
> >
>
Dean Guest



Reply With Quote

