Click here to Skip to main content
15,921,793 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
hi;
i want include my database entities in view page of mvc3 aspx so i can write like this
<%@model dropdownlist.Models.ProjectManagementSystemEntities %>
but this is not write so how can i write?
Posted

1 solution

Hello There,

If You Want to add your entity in view page then first mention it in controller like :

C#
var varProjectManagement = from sec in objdata.ProjectManagementSystemEntities select sec;

ViewData["ProjectManagement"] = new SelectList(varProjectManagement .ToList(), ionId", "Text");


and then use this viewdata in view like :-

C#
@Html.DropDownList("ProjectManagement", (IEnumerable<SelectListItem>)ViewData["ProjectManagement"],"--Select--")


Hope this will help you

Regards
Andy.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900