an ASP.NET Open Source CMS & eCommerce platform
Search:
Skip Navigation LinksHome > DotShoppingCart Forums > Support > Using DotShoppingCart > Error adding to HTML box in Page Editor mode
Last Post 5/15/2009 9:15:49 AM By lukezy. 5 replies.
5/12/2009 4:56:43 PM
jsduggan
Posts: 52
Joined: 3/19/2009
Error adding to HTML box in Page Editor mode
Hi Luke,
 
I was adding to an HTML box in Page Editor and received this message when I clicked on "Ok" at the end.  I am not sure what is meant by "Url".  All I was doing was typing into an HTML box on one of my pages.  Thought?
 
Thanks,
Jeff
 
<span> 

Server Error in '/' Application. <hr width="100%" color="#c0c0c0" size="1" />

Cannot insert the value NULL into column 'Url', table 'dotshoppingcart.dbo.DSC_Html'; column does not allow nulls. INSERT fails.
The statement has been terminated.

</span>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: Cannot insert the value NULL into column 'Url', table 'dotshoppingcart.dbo.DSC_Html'; column does not allow nulls. INSERT fails.
The statement has been terminated.

Source Error:

<table width="100%" bgcolor="#ffffcc"> <tbody> <tr> <td>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.</td> </tr> </tbody> </table>
Stack Trace:

<table width="100%" bgcolor="#ffffcc"> <tbody> <tr> <td>
[SqlException (0x80131904): Cannot insert the value NULL into column 'Url', table 'dotshoppingcart.dbo.DSC_Html'; column does not allow nulls. INSERT fails.
The statement has been terminated.]
   System.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection) +212
   System.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj) +245
   System.Data.SqlClient.TdsParser.Run(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj) +2811
   System.Data.SqlClient.SqlDataReader.ConsumeMetaData() +87
   System.Data.SqlClient.SqlDataReader.get_MetaData() +112
   System.Data.SqlClient.SqlCommand.FinishExecuteReader(SqlDataReader ds, RunBehavior runBehavior, String resetOptionsString) +2476500
   System.Data.SqlClient.SqlCommand.RunExecuteReaderTds(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, Boolean async) +2478033
   System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method, DbAsyncResult result) +424
   System.Data.SqlClient.SqlCommand.RunExecuteReader(CommandBehavior cmdBehavior, RunBehavior runBehavior, Boolean returnStream, String method) +28
   System.Data.SqlClient.SqlCommand.ExecuteReader(CommandBehavior behavior, String method) +211
   System.Data.SqlClient.SqlCommand.ExecuteDbDataReader(CommandBehavior behavior) +19
   System.Data.Linq.SqlClient.SqlProvider.Execute(Expression query, QueryInfo queryInfo, IObjectReaderFactory factory, Object[] parentArgs, Object[] userArgs, ICompiledSubQuery[] subQueries, Object lastResult) +1177
   System.Data.Linq.SqlClient.SqlProvider.ExecuteAll(Expression query, QueryInfo[] queryInfos, IObjectReaderFactory factory, Object[] userArguments, ICompiledSubQuery[] subQueries) +207
   System.Data.Linq.SqlClient.SqlProvider.System.Data.Linq.Provider.IProvider.Execute(Expression query) +576
   System.Data.Linq.StandardChangeDirector.DynamicInsert(TrackedObject item) +169
   System.Data.Linq.StandardChangeDirector.Insert(TrackedObject item) +220
   System.Data.Linq.ChangeProcessor.SubmitChanges(ConflictMode failureMode) +342
   System.Data.Linq.DataContext.SubmitChanges(ConflictMode failureMode) +659
   Controls_Blocks_HtmlBox.btnEditOkClick(Object sender, EventArgs e) in c:\temp\JeffWeb\Web\Controls\Blocks\HtmlBox.ascx.cs:129
   System.Web.UI.WebControls.Button.OnClick(EventArgs e) +115
   System.Web.UI.WebControls.Button.RaisePostBackEvent(String eventArgument) +140
   System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +29
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +2981
</td> </tr> </tbody> </table>
<hr width="100%" color="#c0c0c0" size="1" /> Version Information: Microsoft .NET Framework Version:2.0.50727.3053; ASP.NET Version:2.0.50727.3053
5/12/2009 5:48:20 PM
lukezy
Posts: 2109
Joined: 6/12/2007
Location:WA, US
Re: Error adding to HTML box in Page Editor mode
If you look at web\controls\blocks\HtmlBox.ascx.cs, the "Url" comes from the Session. It's set when you opened the page editor.
    Url = (string)Session["PreviousUrl"],
If it's null then it makes me think that your IIS app pool gets recycled between the time that you opened the page editor and when you clicked the "OK" button. Check your IIS app pool settings. Make sure it's not recylced too often. Once a day is a pretty good number of an average site.
DotShoppingCart Staff
5/13/2009 11:52:39 PM
jsduggan
Posts: 52
Joined: 3/19/2009
Re: Error adding to HTML box in Page Editor mode
Hi Luke,
 
I dont think the Application Pool recycle setting is the problem.  The same thing happened earlier today.  I made changes in the page editor and when I clicked OK I got this same error message.  I checked the application pool setting and it was set to recycle every 29 hours what you suggested it be set at.
 
What else could be causing this problem? 
 
Thanks,
Jeff
5/13/2009 11:56:55 PM
lukezy
Posts: 2109
Joined: 6/12/2007
Location:WA, US
Re: Error adding to HTML box in Page Editor mode
The error means your session times out. How long between the time you log in and when you submit?
 
When you log in to your site, check "Remember me next time" checkbox. Let me know if it makes any difference.
DotShoppingCart Staff
5/15/2009 8:43:21 AM
jsduggan
Posts: 52
Joined: 3/19/2009
Re: Error adding to HTML box in Page Editor mode
Luke,
 
I am still getting the same error even though I click the "Remember me next time" checkbox.  It is a little frustrating because I lose the work that I did up to that point when I submit and get this error.  Do you still think it is a time-out problem?  If so, is there a way to increase the time so that it takes longer to time-out?
 
Thanks!
 
5/15/2009 9:15:49 AM
lukezy
Posts: 2109
Joined: 6/12/2007
Location:WA, US
Re: Error adding to HTML box in Page Editor mode
Check web.config. I believe it sets timeout to 20160 minutes (28 days) by default.  
 
        <authenticationmode="Forms">
            <formsname=".ASPNET"loginUrl="login.aspx"cookieless="UseCookies"protection="All"timeout="20160"path="/"/>
        </authentication>
 
In your situation I believe your server constantly recycles your app pool so that your session is lost. You can configure the session state to use a different mode e.g. out of process mode so that an app pool reset won't affect your session. Check more detail from MSDN.
DotShoppingCart Staff