Last post Oct 06, 2011 12:00 PM by todo1979
Oct 06, 2011 09:38 AM|todo1979|LINK
Hi to all,
I have a problem here, I run my application with 2 browsers at the same time, I click on controls, variables are changed ... and finally when the results are written to the database.... they are all mixed (there are values from 1 browser to another) so when
2 or more clients are connecting to my application from distinct places, everyone should have its own values, but this is not happening.
So, I'm trying to use sessionstate values to differentiate the users by their browsers.
Protected Sub Button10_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles Button10.Click
' insert values into database
in default.aspx I have:
<%@ Page Language="VB" AutoEventWireup="true" CodeFile="default.aspx.vb" Inherits="_Default" Strict="false" EnableSessionState="True" Explicit="false" %>
in default.aspx.vb I have:
in web.config I have:
sqlConnectionString="data source=admin-pc;Integrated Security=SSPI"
<add name="Session" type="System.Web.SessionState.SessionStateModule" />
In services.msc I have asp.net state service running
Now, I don't know what else to do, I keep getting this error:
Session state can only be used when enableSessionState is set to true, either in a configuration file or in the Page directive. Please also make sure that System.Web.SessionStateModule or a custom session state module is included in the <configuration>\<system.web>\<httpModules>
section in the application configuration.
I do not have login.aspx (do I need to have one?) - the application is simple, basically I don't want the clients to be forced to login before using the interface, they simply need to start the application, insert their own values, click on controls and
thats all, and I don't have aspnetdb.mdf (do I need to have one?)
What to do to enable sessionstate?
Oct 06, 2011 09:48 AM|robwscott|LINK
in your connectionstring for sessionState
I was checking the session state parameters from your Web.Config. I believe there is a typo error. Please verify the web.config again and test.....
In the SessionState tag, the cookieless attribute only accepts the value of "true" or "false", but your web.config shows as "UseCookies"
<sessionState mode="InProc" timeout="20" cookieless="UseCookies" />
Oct 06, 2011 10:11 AM|todo1979|LINK
Hi and thanks for your answer but it's not working
if someone could provide me with a working example of the configuration it would be much appreciated, a few setting in default.aspx, default.aspx.vb, web.config or maybe a very simple project because I really don't know what else to do
Oct 06, 2011 12:00 PM|todo1979|LINK
I fixed it,
in public sub new() I've tryed to set values but it seems like I should have set the values in page load event because asp net state wasn't loaded yet (or something :)) )
forgive my bad english