views:

26

answers:

1

This should be simple and I don't know why the compiler is complaining.

I have a view and I want to shorten this call inside it:

<div id = "catalog">
        <table id = "catalogContainer">
            <% while ((category = SomeNamespace.Helper.
                                  GetNextCategory(categoryIndex++)) != null)

to not qualify every types with the namespace, so I did this:

<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" 
Inherits="System.Web.Mvc.ViewPage" %>

<%@ Import Namespace = "SomeNamespace" >

and then down in the mark-up somewhere, I omitted the namespace like so:

<div id = "catalog">
        <table id = "catalogContainer">
            <% while ((category = Helper.
                                  GetNextCategory(categoryIndex++)) != null)

But the compiler keeps giving me the red squiggly below the type name Helper saying it can't find it.

+1  A: 

I just add it to my web.config

<system.web>
    <pages>
        <namespaces>
            <add namespace="SomeNamespace"/>
        <namespaces>
    </pages>
</system.web>
jessegavin