Advertisement
Guest User

Untitled

a guest
Jan 5th, 2014
116
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.63 KB | None | 0 0
  1.  
  2. namespace MyProject.Extensions.Controllers
  3. {
  4.     public class MyActionController : FormController
  5.     {
  6.         public ActionResult MyAction()
  7.         {
  8.             var baseModel = GetModel<BaseModel>();
  9.  
  10.             MyActionViewModel viewModel = new MyActionViewModel();
  11.  
  12.             IEnumerable<Company> companies = GetCompanies();
  13.  
  14.             viewModel.Companies = new List<SelectListItem>();
  15.  
  16.             var company = new SelectListItem();
  17.             company.Text = "Acme";
  18.             company.Value = "1";
  19.  
  20.             viewModel.Companies.Add(company);
  21.  
  22.             return CurrentTemplate(viewModel);
  23.         }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement