Wednesday, 7 August 2013

EditorFor isn't working on classes in different dll

EditorFor isn't working on classes in different dll

I have a solution with two projects.
One of them contains data access layer classes(DAL.dll),and other one is
ASP.NET MVC project.ASP.NET MVC project depends on DAL.dll. I want to use
DAL.dll classes in model class in ASP.NET MVC project.
Suppose that i have a class in DAL.dll as follow:
pub class Test{
public string Description{get;set;}
}
and in ASP.NET MVC project i have a model class that uses Test.cs as follow:
public class ModelClass{
Test CrudModel{get;set;}
public string Description{get;set;}
}
And in my view(*.cshtml) i have following code :
@Html.EditorFor(model => model.CrudModel.Description, "tinymce_jquery_min")
in above code @Html.EditorFor does not render "tinymce_jquery_min" template.
but when i use the following code, @Html.EditorFor does render
"tinymce_jquery_min" template:
@Html.EditorFor(model => model.Description, "tinymce_jquery_min")
Why @Html.EditorFor only render template for properties those are in model
class in ASP.NET MVC project and not for properties in different dll?

No comments:

Post a Comment