tags:

views:

51

answers:

3

Hi there,

Is there a reason why i can't reference any assemblies from my master page or views?

So for example in my controler classes I can go MyRootnamespace.OtherAssembly.ClassName but when I do this in my view like:
<% MyRootnamespace.OtherAssembly.ClassName %>

it says OtherAssembly does not belong to MyRootnamespace

+1  A: 

Try adding the line

<add namespace="MyApp.MyNamespace"/>

to the namespaces section of your web.config.

Matthias
Tried and recompiled, didn't work :(
Soul_Master
A: 

Before using new namespace in Asp.net Mvc page like master page, view page. Please add namespace(s) that you want to use to web.config file.

<configuration>
    <system.web>
        <pages>
            <namespaces>
                <add namespace="[Your Namespace]" />
            </namespaces>
        </pages>
    </system.web>  
</configuration>
Soul_Master
A: 

You should probably register the assembly as in a Webform, like on http://support.microsoft.com/kb/321749

<%@ Register Assembly= "MyRootnamespace.OtherAssembly" %>
korro