also another possobility is that somebody tries unsucesfull atempts to login on your server does locking the account? Maybe some bots? Maybe a good idea to add some captcha image to the login form...
<div class=MsoNormal style="MARGIN: 0cm 0cm 10pt; LINE-HEIGHT: normal; TEXT-ALIGN: center; mso-margin-top-alt: auto; mso-margin-bottom-alt: auto; mso-outline-level: 1" align=center>Hi
there, I got this mssg. any suggestion what should be taken care of....
</div> <div class=MsoNormal style="MARGIN: 0cm 0cm 10pt; LINE-HEIGHT: normal; TEXT-ALIGN: center; mso-margin-top-alt: auto; mso-margin-bottom-alt: auto; mso-outline-level: 1" align=center> </div> <div class=MsoNormal style="MARGIN: 0cm 0cm 10pt; LINE-HEIGHT:
normal; TEXT-ALIGN: center; mso-margin-top-alt: auto; mso-margin-bottom-alt: auto; mso-outline-level: 1" align=center> </div>Timeout expired. The timeout period elapsed
prior to completion of the operation or the server is not responding.Description:
An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated
in the code.
Exception Details:
System.Data.SqlClient.SqlException: Timeout expired. The timeout period elapsed prior to completion of the operation or the server is not responding.
Source Error:
Line 6:Sub Application_Start(ByVal sender As Object, ByVal e As EventArgs)Line 7:Line 8:If (Not Roles.RoleExists("Administrators")) ThenLine 9:Roles.CreateRole("Administrators")Line 10:End If
Source File:
C:\Users\shaikh\Documents\Visual Studio 2008\WebSites\zzzzzz\global.asax Line:
8
<div class=MsoNormal style="MARGIN: 0cm 0cm 10pt; LINE-HEIGHT: normal; TEXT-ALIGN: center; mso-margin-top-alt: auto; mso-margin-bottom-alt: auto; mso-outline-level: 1" align=center>Hi
there, I got this mssg. any suggestion what should be taken care of....
</div> <div class=MsoNormal style="MARGIN: 0cm 0cm 10pt; LINE-HEIGHT: normal; TEXT-ALIGN: center; mso-margin-top-alt: auto; mso-margin-bottom-alt: auto; mso-outline-level: 1" align=center> </div> <div class=MsoNormal style="MARGIN: 0cm 0cm 10pt; LINE-HEIGHT:
normal; TEXT-ALIGN: center; mso-margin-top-alt: auto; mso-margin-bottom-alt: auto; mso-outline-level: 1" align=center> </div>Timeout expired. The timeout period elapsed
prior to completion of the operation or the server is not responding.Description:
An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated
in the code.
Exception Details:
System.Data.SqlClient.SqlException: Timeout expired. The timeout period elapsed prior to completion of the operation or the server is not responding.
Source Error:
Line 6:Sub Application_Start(ByVal sender As Object, ByVal e As EventArgs)Line 7:Line 8:If (Not Roles.RoleExists("Administrators")) ThenLine 9:Roles.CreateRole("Administrators")Line 10:End If
Source File:
C:\Users\shaikh\Documents\Visual Studio 2008\WebSites\zzzzzz\global.asax Line:
8
Could you please help me! I am getting the following error mssg. on run
at Login_aspx.PasswordRecovery_Init(Object sender, EventArgs e) in C:\Users\shaikh\Documents\Visual Studio 2008\WebSites\zzzzzz\Login.aspx.vb:line 25 at System.Web.UI.Control.OnInit(EventArgs e) at System.Web.UI.WebControls.PasswordRecovery.OnInit(EventArgs
e) at System.Web.UI.Control.InitRecursive(Control namingContainer) at System.Web.UI.Control.InitRecursive(Control namingContainer) at System.Web.UI.Control.InitRecursive(Control namingContainer) at System.Web.UI.Control.InitRecursive(Control namingContainer)
at System.Web.UI.Control.InitRecursive(Control namingContainer) at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
I am just starting out like you, but here is what makes sense to me.
There is obviously an error in line 8 of your code.
The error seems to be caused because you are trying to login as an administrator, but you do not have administrative privleges. You then try to re-create the administator account in line 8, but I do not believe it would be possible to just recreate that
role.
SQL cannot allow you to connect, so the session Timeout.
I apologize, I did not realize that both posts were relevant.
I noticed something else in your code.
<allow
roles="Administrators"/>
<
deny
users="*"/>
I do not know if they tie in together, but you are allowing roles as administrators, but then denying users "*". If they are relevant to each other, then the more restrictive permissions would go into affect.
Once again, I am no expert, and you quite possibly have a better understanding than myself.
http://www.mikestratton.net
Asp.net? I am not sure that I understand, please speak slowly.
rfurdzik
Contributor
3439 Points
1731 Posts
Re: password get expired every after 2-3 days!
Jul 17, 2008 03:38 PM|LINK
also another possobility is that somebody tries unsucesfull atempts to login on your server does locking the account? Maybe some bots? Maybe a good idea to add some captcha image to the login form...
Buy Sell Domains - DomainsHeat.com
Free ASP.NET controls: Youtube Web Control and Ajax Zoom Control
learner01
Member
36 Points
18 Posts
Re: password get expired every after 2-3 days!
Jul 17, 2008 03:59 PM|LINK
Thanks much for helping me out here & quick response!
How can I unlock the psswd. as you said it gets locked out after no. of attemps?
here is the web.config file copied
<?xml version="1.0"?><
configuration xmlns="http://schemas.microsoft.com/.NetConfiguration/v2.0"> <configSections><
sectionGroup name="system.web.extensions" type="System.Web.Configuration.SystemWebExtensionsSectionGroup, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"> <sectionGroup name="scripting" type="System.Web.Configuration.ScriptingSectionGroup, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"><
section name="scriptResourceHandler" type="System.Web.Configuration.ScriptingScriptResourceHandlerSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" allowDefinition="MachineToApplication"/> <sectionGroup name="webServices" type="System.Web.Configuration.ScriptingWebServicesSectionGroup, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"><
section name="jsonSerialization" type="System.Web.Configuration.ScriptingJsonSerializationSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" allowDefinition="Everywhere"/> <section name="profileService" type="System.Web.Configuration.ScriptingProfileServiceSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" allowDefinition="MachineToApplication"/><
section name="authenticationService" type="System.Web.Configuration.ScriptingAuthenticationServiceSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" allowDefinition="MachineToApplication"/> <section name="roleService" type="System.Web.Configuration.ScriptingRoleServiceSection, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" requirePermission="false" allowDefinition="MachineToApplication"/></sectionGroup></sectionGroup></sectionGroup></configSections><
appSettings> <add key="Test" value="test1" /></
appSettings> <location path="Admin"><
system.web> <authorization><
allow roles="Administrators"/> <deny users="*"/></
authorization> </system.web></
location> <location path="PostAd.aspx"><
system.web> <authorization><
deny users="?"/> </authorization></
system.web> </location><
location path="EditPhotos.aspx"> <system.web><
authorization> <deny users="?"/></
authorization> </system.web></
location> <location path="MyAds.aspx"><
system.web> <authorization><
deny users="?"/> </authorization></
system.web> </location><
location path="MyProfile.aspx"> <system.web><
authorization> <deny users="?"/></
authorization> </system.web></
location> <system.web><
authentication mode="Forms" /> <customErrors defaultRedirect="Error.aspx" mode="RemoteOnly"/><
pages styleSheetTheme="Red"> <controls><
add tagPrefix="asp" namespace="System.Web.UI" assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/> <add tagPrefix="asp" namespace="System.Web.UI.WebControls" assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/></controls></pages><
membership> <providers><
clear/> <add name="AspNetSqlMembershipProvider" type="System.Web.Security.SqlMembershipProvider, System.Web, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" connectionStringName="LocalSqlServer" enablePasswordRetrieval="false" enablePasswordReset="true" requiresQuestionAndAnswer="true" applicationName="/" requiresUniqueEmail="true" passwordFormat="Hashed" maxInvalidPasswordAttempts="10" minRequiredPasswordLength="5" minRequiredNonalphanumericCharacters="0" passwordAttemptWindow="10" passwordStrengthRegularExpression=""/></
providers> </membership><
profile enabled="true"> <properties><
add name="FirstName" type="System.String"/> <add name="LastName" type="System.String"/><
add name="MemberId" defaultValue="0" type="System.Int32"/> <group name="Core"/></
properties> </profile><
roleManager enabled="true"/> <compilation debug="true"><
assemblies> <add assembly="System.Core, Version=3.5.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/><
add assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/> <add assembly="System.Xml.Linq, Version=3.5.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/><
add assembly="System.Data.DataSetExtensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/></assemblies></compilation> <siteMap defaultProvider="RoleEnabled_AspNetXmlSiteMapProvider" enabled="true"><
providers> <clear/><
add name="RoleEnabled_AspNetXmlSiteMapProvider" type="System.Web.XmlSiteMapProvider, System.Web, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" siteMapFile="web.sitemap" securityTrimmingEnabled="true"/> </providers></
siteMap> <httpHandlers><
remove verb="*" path="*.asmx"/> <add verb="*" path="*.asmx" validate="false" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/><
add verb="*" path="*_AppService.axd" validate="false" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/> <add verb="GET,HEAD" path="ScriptResource.axd" validate="false" type="System.Web.Handlers.ScriptResourceHandler, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/></httpHandlers><
httpModules> <add name="ScriptModule" type="System.Web.Handlers.ScriptModule, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/></httpModules></system.web><
connectionStrings> <add name="classifiedsConnection" connectionString="Data Source=.\SQLEXPRESS;AttachDbFilename=|DataDirectory|\classifiedsdb.mdf;Integrated Security=True;User Instance=True" providerName="System.Data.SqlClient"/></
connectionStrings> <system.net><
mailSettings> <smtp><
network host="" port="25" defaultCredentials="true" userName="" password=""/>/
> </smtp></
mailSettings> </system.net><
system.codedom> <compilers><
compiler language="c#;cs;csharp" extension=".cs" type="Microsoft.CSharp.CSharpCodeProvider,System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" warningLevel="4"> <providerOption name="CompilerVersion" value="v3.5"/><
providerOption name="WarnAsError" value="false"/></compiler> <compiler language="vb;vbs;visualbasic;vbscript" extension=".vb" type="Microsoft.VisualBasic.VBCodeProvider, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" warningLevel="4"><
providerOption name="CompilerVersion" value="v3.5"/> <providerOption name="OptionInfer" value="true"/><
providerOption name="WarnAsError" value="false"/></compiler></compilers></system.codedom> <system.webServer><
validation validateIntegratedModeConfiguration="false"/> <modules><
remove name="ScriptModule"/> <add name="ScriptModule" preCondition="managedHandler" type="System.Web.Handlers.ScriptModule, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/></modules><
handlers> <remove name="WebServiceHandlerFactory-Integrated"/><
remove name="ScriptHandlerFactory"/> <remove name="ScriptHandlerFactoryAppServices"/><
remove name="ScriptResource"/> <add name="ScriptHandlerFactory" verb="*" path="*.asmx" preCondition="integratedMode" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/><
add name="ScriptHandlerFactoryAppServices" verb="*" path="*_AppService.axd" preCondition="integratedMode" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/> <add name="ScriptResource" verb="GET,HEAD" path="ScriptResource.axd" preCondition="integratedMode" type="System.Web.Handlers.ScriptResourceHandler, System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/></handlers></system.webServer><
runtime> <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1"><
dependentAssembly> <assemblyIdentity name="System.Web.Extensions" publicKeyToken="31bf3856ad364e35"/><
bindingRedirect oldVersion="1.0.0.0-1.1.0.0" newVersion="3.5.0.0"/></dependentAssembly> <dependentAssembly><
assemblyIdentity name="System.Web.Extensions.Design" publicKeyToken="31bf3856ad364e35"/> <bindingRedirect oldVersion="1.0.0.0-1.1.0.0" newVersion="3.5.0.0"/></dependentAssembly></assemblyBinding></runtime></configuration>learner01
Member
36 Points
18 Posts
Re: password get expired every after 2-3 days!
Jul 23, 2008 02:28 AM|LINK
</div> <div class=MsoNormal style="MARGIN: 0cm 0cm 10pt; LINE-HEIGHT: normal; TEXT-ALIGN: center; mso-margin-top-alt: auto; mso-margin-bottom-alt: auto; mso-outline-level: 1" align=center> </div> <div class=MsoNormal style="MARGIN: 0cm 0cm 10pt; LINE-HEIGHT: normal; TEXT-ALIGN: center; mso-margin-top-alt: auto; mso-margin-bottom-alt: auto; mso-outline-level: 1" align=center> </div>Timeout expired. The timeout period elapsed prior to completion of the operation or the server is not responding. Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.Data.SqlClient.SqlException: Timeout expired. The timeout period elapsed prior to completion of the operation or the server is not responding.
Source Error:
Line 6: Sub Application_Start(ByVal sender As Object, ByVal e As EventArgs)Line 7: Line 8: If (Not Roles.RoleExists("Administrators")) ThenLine 9: Roles.CreateRole("Administrators")Line 10: End IfSource File: C:\Users\shaikh\Documents\Visual Studio 2008\WebSites\zzzzzz\global.asax Line: 8
Stack Trace:
[SqlException (0x80131904): Timeout expired. The timeout period elapsed prior to completion of the operation or the server is not responding.] System.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection) +800131 System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj) +186 System.Data.SqlClient.TdsParserStateObject.ReadSniError(TdsParserStateObject stateObj, UInt32 error) +556 System.Data.SqlClient.TdsParserStateObject.ReadSni(DbAsyncResult asyncResult, TdsParserStateObject stateObj) +164 System.Data.SqlClient.TdsParserStateObject.ReadPacket(Int32 bytesExpected) +34 System.Data.SqlClient.TdsParserStateObject.ReadBuffer() +44 System.Data.SqlClient.TdsParserStateObject.ReadByte() +17 System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj) +79 System.Data.SqlClient.SqlInternalConnectionTds.CompleteLogin(Boolean enlistOK) +33 System.Data.SqlClient.SqlInternalConnectionTds.AttemptOneLogin(ServerInfo serverInfo, String newPassword, Boolean ignoreSniOpenTimeout, Int64 timerExpire, SqlConnection owningObject) +172 System.Data.SqlClient.SqlInternalConnectionTds.LoginNoFailover(String host, String newPassword, Boolean redirectedUserInstance, SqlConnection owningObject, SqlConnectionString connectionOptions, Int64 timerStart) +381 System.Data.SqlClient.SqlInternalConnectionTds.OpenLoginEnlist(SqlConnection owningObject, SqlConnectionString connectionOptions, String newPassword, Boolean redirectedUserInstance) +181 System.Data.SqlClient.SqlInternalConnectionTds..ctor(DbConnectionPoolIdentity identity, SqlConnectionString connectionOptions, Object providerInfo, String newPassword, SqlConnection owningObject, Boolean redirectedUserInstance) +173 System.Data.SqlClient.SqlConnectionFactory.CreateConnection(DbConnectionOptions options, Object poolGroupProviderInfo, DbConnectionPool pool, DbConnection owningConnection) +133 System.Data.ProviderBase.DbConnectionFactory.CreatePooledConnection(DbConnection owningConnection, DbConnectionPool pool, DbConnectionOptions options) +30 System.Data.ProviderBase.DbConnectionPool.CreateObject(DbConnection owningObject) +424 System.Data.ProviderBase.DbConnectionPool.UserCreateRequest(DbConnection owningObject) +66 System.Data.ProviderBase.DbConnectionPool.GetConnection(DbConnection owningObject) +494 System.Data.ProviderBase.DbConnectionFactory.GetConnection(DbConnection owningConnection) +82 System.Data.ProviderBase.DbConnectionClosed.OpenConnection(DbConnection outerConnection, DbConnectionFactory connectionFactory) +105 System.Data.SqlClient.SqlConnection.Open() +111 System.Web.DataAccess.SqlConnectionHolder.Open(HttpContext context, Boolean revertImpersonate) +114 System.Web.DataAccess.SqlConnectionHelper.GetConnection(String connectionString, Boolean revertImpersonation) +225 System.Web.Security.SqlRoleProvider.RoleExists(String roleName) +611 System.Web.Security.Roles.RoleExists(String roleName) +70 ASP.global_asax.Application_Start(Object sender, EventArgs e) in C:\Users\shaikh\Documents\Visual Studio 2008\WebSites\zzzzzzz\global.asax:8</div>
Version Information: Microsoft .NET Framework Version:2.0.50727.1434; ASP.NET Version:2.0.50727.1434
learner01
Member
36 Points
18 Posts
Re: password get expired every after 2-3 days!
Jul 23, 2008 02:28 AM|LINK
</div> <div class=MsoNormal style="MARGIN: 0cm 0cm 10pt; LINE-HEIGHT: normal; TEXT-ALIGN: center; mso-margin-top-alt: auto; mso-margin-bottom-alt: auto; mso-outline-level: 1" align=center> </div> <div class=MsoNormal style="MARGIN: 0cm 0cm 10pt; LINE-HEIGHT: normal; TEXT-ALIGN: center; mso-margin-top-alt: auto; mso-margin-bottom-alt: auto; mso-outline-level: 1" align=center> </div>Timeout expired. The timeout period elapsed prior to completion of the operation or the server is not responding. Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.
Exception Details: System.Data.SqlClient.SqlException: Timeout expired. The timeout period elapsed prior to completion of the operation or the server is not responding.
Source Error:
Source File: C:\Users\shaikh\Documents\Visual Studio 2008\WebSites\zzzzzz\global.asax Line: 8
Stack Trace:
</div>
Version Information: Microsoft .NET Framework Version:2.0.50727.1434; ASP.NET Version:2.0.50727.1434
learner01
Member
36 Points
18 Posts
Re: psswd getting expired after every 2-3days...
Jul 23, 2008 02:49 AM|LINK
Hi
Could you please help me! I am getting the following error mssg. on run
at Login_aspx.PasswordRecovery_Init(Object sender, EventArgs e) in C:\Users\shaikh\Documents\Visual Studio 2008\WebSites\zzzzzz\Login.aspx.vb:line 25 at System.Web.UI.Control.OnInit(EventArgs e) at System.Web.UI.WebControls.PasswordRecovery.OnInit(EventArgs e) at System.Web.UI.Control.InitRecursive(Control namingContainer) at System.Web.UI.Control.InitRecursive(Control namingContainer) at System.Web.UI.Control.InitRecursive(Control namingContainer) at System.Web.UI.Control.InitRecursive(Control namingContainer) at System.Web.UI.Control.InitRecursive(Control namingContainer) at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
intechspecia...
Member
42 Points
31 Posts
Re: password get expired every after 2-3 days!
Jul 23, 2008 05:08 AM|LINK
I am just starting out like you, but here is what makes sense to me.
There is obviously an error in line 8 of your code.
The error seems to be caused because you are trying to login as an administrator, but you do not have administrative privleges. You then try to re-create the administator account in line 8, but I do not believe it would be possible to just recreate that role.
SQL cannot allow you to connect, so the session Timeout.
Please join me in your path to learn development!
www.ptsdonline.com
Asp.net? I am not sure that I understand, please speak slowly.
intechspecia...
Member
42 Points
31 Posts
Re: password get expired every after 2-3 days!
Jul 23, 2008 05:09 AM|LINK
The error is in line 25 of you code, fix the problem, and then tell me how its done at this website:
www.ptsdonline.com
Asp.net? I am not sure that I understand, please speak slowly.
intechspecia...
Member
42 Points
31 Posts
Re: password get expired every after 2-3 days!
Jul 23, 2008 05:14 AM|LINK
I apologize, I did not realize that both posts were relevant.
I noticed something else in your code.
<allow roles="Administrators"/><
deny users="*"/>I do not know if they tie in together, but you are allowing roles as administrators, but then denying users "*". If they are relevant to each other, then the more restrictive permissions would go into affect.
Once again, I am no expert, and you quite possibly have a better understanding than myself.
Asp.net? I am not sure that I understand, please speak slowly.
intechspecia...
Member
42 Points
31 Posts
Re: password get expired every after 2-3 days!
Jul 23, 2008 05:15 AM|LINK
I have another question:
What is in line 25 of your code?
Asp.net? I am not sure that I understand, please speak slowly.
darkknight18...
Contributor
2674 Points
1040 Posts
Re: psswd getting expired after every 2-3days...
Jul 25, 2008 02:01 PM|LINK
Hello Learner,
Both your issues are related, the password recovery, and the timeout.
Basically, asp.net sites use an application pool, and if there is a lot of activity when loaded, it will load incorectly.
And you'll get those errors.
I get that error all the time on my local computer, and very rare online.
When it happens locally, just stop the "ASP.NET Developent Server" (little icon that pops up next to the clock)
And load it again, and nothing else until loaded.
After no activity on your site, usually for a few hours, most host servers will remove your application pool,
which when loaded again usually takes 10-30 seconds, if loaded incorectly you could have errors.
What I have found that works for me is open a major file, such as App_Code/BLL/Ads.vb
and you need to make it new, so delete any letter, and then type it back in.
That way it's changed, but really the same.
Upload it, and go to your site.
It should fix the issue.
Good Luck
Daniel
Please remember to mark the post as answer that solves your issue.
This will be greatly benificial for other users.