ASP.NET webforms page designer cannot find a class from different project, used in model binding -


below here code within project named presentation, , have project named mynamespace , mynamespace2 (within same solution) in have classes generated entityframework. added reference of mynamespace project presentation project.

1: <asp:repeater id="myrepeater" runat="server" itemtype="mynamespace.myentityclass" selectmethod="selectmethod"> 2:     <itemtemplate> 3:         <li><a href="<%# item.link %>"> 4:             <%# item.text %> 5:         </a></li> 6:     </itemtemplate> 7: </asp:repeater> 

now when try using intellisense within quotes after itemtype attribute, classes listed mynamespace2, none mynamespace. also, when try run web application navigate page contains above code, though builds successfully, following error:

compiler error message: cs0246: type or namespace name 'mynamespace' not found (are missing using directive or assembly reference?) 

interestingly enough, within designer, intellisense works item's properties, type of item resolved correctly designer.

now wrong here? thanks.

i found problem. seems not enough have other project (mynamespace) referenced in presentation. doing let me use classes in mynamespace in codebehind files, not in aspx files.

i added following lines web.config file, in order use classes in aspx pages:

<configuration> ....   <system.web>   ....     <compilation debug="true" targetframework="4.5">       ....       <assemblies>         .....         <add assembly="mynamespace, version=1.0.0.0, culture=neutral, publickeytoke=null" />       </assemblies>     </compilation>     ....     <pages>     ....       <namespaces>         ....         <add namespace="mynamespace" />       </namespaces>     </pages>   </system.web> </configuration> 

Comments

Popular posts from this blog

html - How to style widget with post count different than without post count -

How to remove text and logo OR add Overflow on Android ActionBar using AppCompat on API 8? -

javascript - storing input from prompt in array and displaying the array -