benpage
benpage

Reputation: 4618

ASP.NET MVC View - cannot access System.Data.Linq

Is there any reason the namespace linq does not appear in system.data when I am in my view in asp.net MVC?

I can access the namespace fine in my code...

EDIT:

I realize this is not good design, I'm just curious

Upvotes: 2

Views: 3033

Answers (2)

Todd
Todd

Reputation: 5117

You may need to add an assembly reference in your project web.config file if it's not there:

<system.web>
    <compilation debug="true">
        <assemblies>
            <add assembly="System.Data.Linq, Version=3.5.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
        </assemblies>
    </compilation>
</system.web>

Upvotes: 5

Kirschstein
Kirschstein

Reputation: 14868

You can try <%@ Import Namespace="System.Data.Linq" %>

But, why do you even need LINQ in your view? You might want to consider keeping the logic you need in a HtmlHelper or your controller.

Upvotes: 0

Related Questions