views:

260

answers:

1

In the RC without CodeBehind, how do i wire up the ascx with the View if I am passing a model to it?

MY CSS CLASSES ALL SAY UNDEFINED.

+1  A: 

If your model is in the web project, you can modify the Page tag to specify that your control inherits from ViewUserControl<YourModel> to make it strongly typed. I've found that if your model is in separate project, though, that you need to add a *.ascx.cs codebehind file for the control, have that class derive from ViewUserControl<YourModel> and fix up the page directive to specify the class in the codebehind.

I've reported the inability to find models in other projects as a bug on CodePlex.

For CSS you will need to include them in the ViewUserControl directly, but with an if (false) tag so that you get intellisense, but the files are not actually re-included during page processing.

 <% if (false) { %>
    <link href=...
 <% } %>
tvanfosson