views:

62

answers:

1

Hi I have created the following controller i want to add view that should have the data access class UserMagnament.Controller.menuitems but when i add view by right clicking on view folder,it is not showing "UserMagnament.Controller.menuitems" in add data class

using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
using UserManagement.Models;

namespace UserManagement.Controllers
{
public class menuitems
{
    EvoLetDataContext db1 = new EvoLetDataContext();
    public menuitems()
    { }
    public IQueryable<UMUserType> menuitems()
    {
        return db1.UMUserTypes;
        //this.Packages = _SysPackage;  
        //this.Modules = _SysModule;  
    }
    public List<SysPackage> Packages { get; private set; }
    public List<SysModule> Modules { get; private set; }
}





public class Default1Controller : Controller
{
    //
    // GET: /Default1/

    public ActionResult Index()
    {
        return View(new menuitems());
    }

}

}

+1  A: 

Did you rebuild your mvc application? Sometimes it helps to populate the class list when adding a View.

Thomas
No controller is shown such as homecontoller, accounts controller etc. only two controllers are visible which are "AccountsMembershipService" and "FormAuthenticaionService".
Tassadaque
What do you mean? When you click on "Add View", the list of available classes for your strongly typed view indeed skips the controllers (AccountsMembershipService and FormAuthenticaionService are helper classes btw, not controllers). Usermanagement.Controllers.menuitems should appear in the class list without problems; once you've build your application.
Thomas
yes controllers are skipped. i think i am missing something, (i have build the solution)
Tassadaque