Rob, I'm afraid my implementation of your suggestion fails. Perhaps I'm doing it wrong?
The model item passed into the dictionary is of type 'Commerce.Data.Category' but this dictionary requires a model item of type 'Commerce.Data.UserProfile'.
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.InvalidOperationException: The model item passed into the dictionary is of type 'Commerce.Data.Category' but this dictionary requires a model item of type 'Commerce.Data.UserProfile'.
Source Error:
Line 19: </div> Line 20: <%/* Html.RenderAction<PersonalizationController>(x => x.Summary());*/%> Line 21: <% Html.RenderPartial("~/App/Views/Personalization/Summary.aspx"); %> Line 22: <div id="main-nav"> Line 23: <ul>
Serverfehler in der Anwendung /.
Der Wert darf nicht NULL sein.
Parametername: httpContext
Zeile 5: <%Html.RenderAction<PersonalizationController>(x =>
Quelldatei: d:\net\MVCStore\Commerce.Web\App\Views\Catalog\Index.aspx Zeile: 5
What shall I change ?
I downloaded the source from last monday (kona.sln), but i got the error "Ungültiger Objektname 'ObjectStore'." in ObjectStore.cs
Can you explain a bit more what this means? I've googled all over and this is about the only post I could find. Looking forward to seeing more with Kona, but i'd like to be able to run and play with the mvc-storefront as well. there seem to be a bunch
of people who have had this problem. I installed MVC 1.0 and the storefront from http://mvcsamples.codeplex.com/Release/ProjectReleases.aspx?ReleaseId=18861. Thanks!
badend
0 Points
1 Post
Httpcontext is null Exception ocurr
Feb 08, 2009 11:59 PM|LINK
Casually it doesnt work.
site.Master
code this
<%Html.RenderAction<PersonalizationController>(x => x.Summary());%>
Message="value could not be null,\r\n parameter name: httpContext"
Source="System.Web.Routing"
ParamName="httpContext"
StackTrace:
: System.Web.Routing.RequestContext..ctor(HttpContextBase httpContext, RouteData routeData)
: Microsoft.Web.Mvc.ViewExtensions.RenderRoute(HtmlHelper helper, RouteValueDictionary values)
: Microsoft.Web.Mvc.ViewExtensions.RenderAction[TController](HtmlHelper helper, Expression`1 action)
: ASP.app_views_shared_site_master.__Render__control1(HtmlTextWriter __w, Control parameterContainer) file d:\svn\private\test\mvssamApps\MVCStore_Preview1A\MVCStore_Preview1A\Commerce.Web\App\Views\Shared\Site.Master:line 20
: System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children)
: System.Web.UI.Control.RenderChildren(HtmlTextWriter writer)
: System.Web.UI.Control.Render(HtmlTextWriter writer)
: System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter)
: System.Web.UI.Control.RenderControl(HtmlTextWriter writer, ControlAdapter adapter)
: System.Web.UI.Control.RenderControl(HtmlTextWriter writer)
: System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children)
: System.Web.UI.Control.RenderChildren(HtmlTextWriter writer)
: System.Web.UI.Page.Render(HtmlTextWriter writer)
: System.Web.Mvc.ViewPage.Render(HtmlTextWriter writer)
: System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter)
: System.Web.UI.Control.RenderControl(HtmlTextWriter writer, ControlAdapter adapter)
: System.Web.UI.Control.RenderControl(HtmlTextWriter writer)
: System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
InnerException:
please give me solution..
xyligan
Member
4 Points
10 Posts
Re: Httpcontext is null Exception ocurr
Feb 09, 2009 08:16 PM|LINK
I have this problem too (
ckelley
Member
10 Points
8 Posts
Re: Httpcontext is null Exception ocurr
Feb 12, 2009 12:52 AM|LINK
Got the same problem.
robconery
Participant
852 Points
195 Posts
Re: Httpcontext is null Exception ocurr
Feb 17, 2009 02:08 AM|LINK
I've refactored that out - it looks like it won't work with RC. You can use RenderPartial to get around it (just render the control outright)
ckelley
Member
10 Points
8 Posts
Re: Httpcontext is null Exception ocurr
Feb 17, 2009 07:25 AM|LINK
RobConery,
I am grateful for your response, but I don't understand what I have to do to the demo project to make it work.
Would you please post the code changes that are needed to get it to work?
biggierock
Member
34 Points
8 Posts
Re: Httpcontext is null Exception ocurr
Mar 02, 2009 12:51 PM|LINK
did you ever figure this out?
biggierock
Member
34 Points
8 Posts
Re: Httpcontext is null Exception ocurr
Mar 02, 2009 02:21 PM|LINK
Rob, I'm afraid my implementation of your suggestion fails. Perhaps I'm doing it wrong?
The model item passed into the dictionary is of type 'Commerce.Data.Category' but this dictionary requires a model item of type 'Commerce.Data.UserProfile'.
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.InvalidOperationException: The model item passed into the dictionary is of type 'Commerce.Data.Category' but this dictionary requires a model item of type 'Commerce.Data.UserProfile'.
Source Error:
Source File: c:\Projects\MVCStoreFront_Preview1\Commerce.Web\App\Views\Shared\Site.Master Line: 21
BerndFfm
Member
2 Points
1 Post
Re: Httpcontext is null Exception ocurr
Mar 26, 2009 08:44 PM|LINK
I got the same errror (in german) :
Serverfehler in der Anwendung /.
Der Wert darf nicht NULL sein.
Parametername: httpContext
Zeile 5: <%Html.RenderAction<PersonalizationController>(x =>
Quelldatei: d:\net\MVCStore\Commerce.Web\App\Views\Catalog\Index.aspx Zeile: 5
What shall I change ?
I downloaded the source from last monday (kona.sln), but i got the error "Ungültiger Objektname 'ObjectStore'." in ObjectStore.cs
Greetings from germany
Bernd
edamon1975
Member
4 Points
2 Posts
Re: Httpcontext is null Exception ocurr
Apr 22, 2009 06:46 PM|LINK
Rob,
Can you explain a bit more what this means? I've googled all over and this is about the only post I could find. Looking forward to seeing more with Kona, but i'd like to be able to run and play with the mvc-storefront as well. there seem to be a bunch of people who have had this problem. I installed MVC 1.0 and the storefront from http://mvcsamples.codeplex.com/Release/ProjectReleases.aspx?ReleaseId=18861. Thanks!
ASP.NET MVC RC1 Storefront
edamon1975
Member
4 Points
2 Posts
Re: Httpcontext is null Exception ocurr
May 06, 2009 02:18 PM|LINK
biggierock, did you figure this out?