ASP.NET Session Problem
3 отговора
250 прегледа
ASP.NET Session Problem
Zdraveite,
imam malko osoben problem, koito se polu4ava samo pri zaqvka kym ASP.NET stranica, koqto izvyr6va zaqvka kym baza danni (Access ili SQL Server), iziskva6ta pove4e vreme za obrabotka, primerno nqkolko sekundi do 10 sekundi. Pri po-byrzi SQL zaqvki, problemat ne se poqvqva. V kakvo se systoi problema: promenlivite zapazeni v Session iz4ezvat. SessionId-to ostava sy6toto. Az re6ih problema, kato syhranqvam session promenlivite v db tablica, no iskam da razbera na kakvo se dylji problema i dali nqkoi drug se e sblyskval s ne6to podobno. Izpolzvam IIS 5.0 na Win 2000 Professional, Visual Studio 2003 i .NET Framework 1.1, nastroikite v Web.config faila za sesiqta sa:
<sessionState
mode="InProc"
stateConnectionString="tcpip=127.0.0.1:42424"
sqlConnectionString="data source=127.0.0.1;Trusted_Connection=yes"
cookieless="false"
timeout="20"
/>
Blagodarq na vseki, koito re6i da otgovori!
imam malko osoben problem, koito se polu4ava samo pri zaqvka kym ASP.NET stranica, koqto izvyr6va zaqvka kym baza danni (Access ili SQL Server), iziskva6ta pove4e vreme za obrabotka, primerno nqkolko sekundi do 10 sekundi. Pri po-byrzi SQL zaqvki, problemat ne se poqvqva. V kakvo se systoi problema: promenlivite zapazeni v Session iz4ezvat. SessionId-to ostava sy6toto. Az re6ih problema, kato syhranqvam session promenlivite v db tablica, no iskam da razbera na kakvo se dylji problema i dali nqkoi drug se e sblyskval s ne6to podobno. Izpolzvam IIS 5.0 na Win 2000 Professional, Visual Studio 2003 i .NET Framework 1.1, nastroikite v Web.config faila za sesiqta sa:
<sessionState
mode="InProc"
stateConnectionString="tcpip=127.0.0.1:42424"
sqlConnectionString="data source=127.0.0.1;Trusted_Connection=yes"
cookieless="false"
timeout="20"
/>
Blagodarq na vseki, koito re6i da otgovori!
Re: ASP.NET Session Problem
Ей тук малко Google:
[линк]
In .NET, there is an additional setting for this. The default script timeout is set to 90 seconds by the httpRuntime section of the machine.config file. You can change this setting to affect all applications on your site, or you can override the settings in your application-specific web.config as follows:
<system.web>
<httpRuntime executionTimeout="900" />
</system.web>
The .NET config files are usually stored in the folder C:\Windows\Microsoft.NET\Framework\[version]\Config where [version] is the version of the .NET Framework such as v1.1.4322. You may need to restart IIS for such changes to take effect.
Never fail, never quit!
[линк]
In .NET, there is an additional setting for this. The default script timeout is set to 90 seconds by the httpRuntime section of the machine.config file. You can change this setting to affect all applications on your site, or you can override the settings in your application-specific web.config as follows:
<system.web>
<httpRuntime executionTimeout="900" />
</system.web>
The .NET config files are usually stored in the folder C:\Windows\Microsoft.NET\Framework\[version]\Config where [version] is the version of the .NET Framework such as v1.1.4322. You may need to restart IIS for such changes to take effect.
Never fail, never quit!
Re: ASP.NET Session Problem
Пробвай:
<sessionState
mode="InProc"
stateConnectionString="tcpip=127.0.0.1:42424"
sqlConnectionString="data source=127.0.0.1;Trusted_Connection=yes"
cookieless="true"
timeout="20"
/>
<sessionState
mode="InProc"
stateConnectionString="tcpip=127.0.0.1:42424"
sqlConnectionString="data source=127.0.0.1;Trusted_Connection=yes"
cookieless="true"
timeout="20"
/>
Re: ASP.NET Session Problem
PROBVAI S TOVA....(AKO SQL-a DAVA TIME-OUT)
Protected Sub SqlDataSource_Selecting(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.SqlDataSourceSelectingEventArgs) Handles SqlDataSource.Selecting
e.Command.CommandTimeout = 3000
End Sub
Protected Sub SqlDataSource_Selecting(ByVal sender As Object, ByVal e As System.Web.UI.WebControls.SqlDataSourceSelectingEventArgs) Handles SqlDataSource.Selecting
e.Command.CommandTimeout = 3000
End Sub