Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


These support forums are now closed for new topics and comments.
Please head on over to http://eureka.ucommerce.net/ for support.

  • Morgan K. 16 posts 57 karma points
    Jan 19, 2013 @ 00:08
    Morgan K.
    0

    Ucommerce Demo Razor in Mvc

    I'm trying to use the razor code for navigation from the Ucommerce demo in my project, using mvc.  I keep either getting the page with no navigation, or a server error "CS0103: The name 'category' does not exist in the current context".

    Line 13:        foreach (var category in categories){
    Line 14:       <div class="toptest">
    Line 15:           <a href="#" class="topnavtext topnavvitamins-supplements topnavlinklevel0" title="">@category.DisplayName()</a>
    Line 16:           <div class="subnavright"></div>
    Line 17:      </div>

    Any help would be appreciated!

     

    -Morgan 

  • Søren Spelling Lund 1797 posts 2786 karma points
    Jan 21, 2013 @ 22:05
    Søren Spelling Lund
    0

    You want to make sure that the catalog context is initialized properly.

    By default uCommerce uses querystring parameters in the URL to determine what the current catalog, category, and product is. If you're using a custom URL scheme you will want to override the default CatalogContext class with your own.

    For MVC I don't believe changing the URL rewriting rules is applicaple.

Please Sign in or register to post replies

Write your reply to:

Draft