Httpcontext is null Exception ocurr

Last post 05-21-2009 6:05 AM by eriera1@gmail.com. 13 replies.

Sort Posts:

  • Httpcontext is null Exception ocurr

    02-08-2009, 7:59 PM
    • Member
      point Member
    • badend
    • Member since 02-09-2009, 12:55 AM
    • Posts 1

    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..

  • Re: Httpcontext is null Exception ocurr

    02-09-2009, 4:16 PM
    • Member
      4 point Member
    • xyligan
    • Member since 06-16-2008, 2:05 PM
    • Kiev
    • Posts 10

     

    I have this problem too (

  • Re: Httpcontext is null Exception ocurr

    02-11-2009, 8:52 PM
    • Member
      6 point Member
    • ckelley
    • Member since 02-23-2007, 9:25 PM
    • Bay Area, CA
    • Posts 6

    Got the same problem.

    -- Bin Laidand
  • Re: Httpcontext is null Exception ocurr

    02-16-2009, 10:08 PM
    • Participant
      846 point Participant
    • robconery
    • Member since 02-23-2005, 10:16 PM
    • Posts 192
    • AspNetTeam

    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)

  • Re: Httpcontext is null Exception ocurr

    02-17-2009, 3:25 AM
    • Member
      6 point Member
    • ckelley
    • Member since 02-23-2007, 9:25 PM
    • Bay Area, CA
    • Posts 6

    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?

    -- Bin Laidand
  • Re: Httpcontext is null Exception ocurr

    03-02-2009, 8:51 AM
    • Member
      34 point Member
    • biggierock
    • Member since 01-17-2006, 4:15 PM
    • Posts 8

     did you ever figure this out?

  • Re: Httpcontext is null Exception ocurr

    03-02-2009, 10:21 AM
    • Member
      34 point Member
    • biggierock
    • Member since 01-17-2006, 4:15 PM
    • Posts 8

     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>

    Source File: c:\Projects\MVCStoreFront_Preview1\Commerce.Web\App\Views\Shared\Site.Master    Line: 21
     

  • Re: Httpcontext is null Exception ocurr

    03-26-2009, 4:44 PM
    • Member
      2 point Member
    • BerndFfm
    • Member since 03-26-2009, 8:15 PM
    • Posts 1

     

    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

  • Re: Httpcontext is null Exception ocurr

    04-22-2009, 2:46 PM
    • Member
      4 point Member
    • edamon1975
    • Member since 04-18-2006, 8:05 PM
    • Posts 2

    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!

  • Re: Httpcontext is null Exception ocurr

    05-06-2009, 10:18 AM
    • Member
      4 point Member
    • edamon1975
    • Member since 04-18-2006, 8:05 PM
    • Posts 2

     biggierock, did you figure this out?

  • Re: Httpcontext is null Exception ocurr

    05-15-2009, 4:04 AM
    • Member
      2 point Member
    • alexyeung
    • Member since 05-15-2009, 8:00 AM
    • Posts 1

    I have this problem too Crying

  • Re: Httpcontext is null Exception ocurr

    05-15-2009, 4:55 AM
    • Member
      2 point Member
    • Lolofrance
    • Member since 05-15-2009, 8:54 AM
    • Posts 1

     The same for me , in French....Tongue Tied

  • Re: Httpcontext is null Exception ocurr

    05-18-2009, 12:16 AM
    • Member
      3 point Member
    • micmit
    • Member since 03-13-2008, 5:45 AM
    • Posts 9

    The same error  for download from the tab "Downloads".  However the most recent changeset ( the project is called Kona now  ) from the tab "Source code"  does work .

  • Re: Httpcontext is null Exception ocurr

    05-21-2009, 6:05 AM

    I guess localization support is in the todo list.

    My default culture language is "es". To make it work with the current database records I had to change these bits in the HomeController.cs:

            public ActionResult Index(string slug) {

                slug = slug ?? "/";
                //this.CurrentPage = _cmsRepository.GetPage(slug, System.Globalization.CultureInfo.CurrentCulture.TwoLetterISOLanguageName);
                this.CurrentPage = _cmsRepository.GetPage(slug, "en");

                return View();
            }

      

    Not sure if there are some other places in the application where the default culture info matters...

    HTH,

    Eduard 

     

Page 1 of 1 (14 items)