Click here to Skip to main content
15,923,168 members
Home / Discussions / Web Development
   

Web Development

 
GeneralRe: SiganalR in MVC Pin
Richard MacCutchan20-Jun-16 23:52
mveRichard MacCutchan20-Jun-16 23:52 
QuestionHow to do Load Balancing for Different Tier Pin
chaurasiashankar20-Jun-16 2:36
chaurasiashankar20-Jun-16 2:36 
AnswerRe: How to do Load Balancing for Different Tier Pin
Kornfeld Eliyahu Peter20-Jun-16 8:34
professionalKornfeld Eliyahu Peter20-Jun-16 8:34 
QuestionSetting up a Login on a Web Site Pin
BobInNJ17-Jun-16 12:27
BobInNJ17-Jun-16 12:27 
SuggestionRe: Setting up a Login on a Web Site Pin
Richard Deeming17-Jun-16 12:59
mveRichard Deeming17-Jun-16 12:59 
GeneralRe: Setting up a Login on a Web Site Pin
BobInNJ17-Jun-16 13:22
BobInNJ17-Jun-16 13:22 
GeneralRe: Setting up a Login on a Web Site Pin
Richard Deeming17-Jun-16 13:30
mveRichard Deeming17-Jun-16 13:30 
AnswerRe: Setting up a Login on a Web Site Pin
Nathan Minier20-Jun-16 1:38
professionalNathan Minier20-Jun-16 1:38 
QuestionPHP scripts to compress HTML,CSS and JS Pin
CDPS11-Jun-16 4:51
CDPS11-Jun-16 4:51 
QuestionIs there a Javascript forum here? Pin
bulrush40010-Jun-16 3:13
bulrush40010-Jun-16 3:13 
PraiseRe: Is there a Javascript forum here? Pin
John C Rayan15-Jun-16 1:30
professionalJohn C Rayan15-Jun-16 1:30 
Questionwhen go to previous page it show confirm submission how to solve this problem in php? Pin
Member 125759089-Jun-16 18:54
Member 125759089-Jun-16 18:54 
QuestionHow to open new window on form submit Pin
Member 125749759-Jun-16 5:01
Member 125749759-Jun-16 5:01 
AnswerRe: How to open new window on form submit Pin
John C Rayan15-Jun-16 1:33
professionalJohn C Rayan15-Jun-16 1:33 
QuestionSignalR bad Request Error Pin
Kevin Marois4-Jun-16 12:35
professionalKevin Marois4-Jun-16 12:35 
AnswerRe: SignalR bad Request Error Pin
Richard Deeming6-Jun-16 5:06
mveRichard Deeming6-Jun-16 5:06 
GeneralRe: SignalR bad Request Error Pin
Kevin Marois6-Jun-16 5:18
professionalKevin Marois6-Jun-16 5:18 
QuestionSignalR Bad Web Request Pin
Kevin Marois4-Jun-16 12:33
professionalKevin Marois4-Jun-16 12:33 
QuestionGoogle MAP with Multiple Marked location Pin
Member 118050633-Jun-16 3:37
Member 118050633-Jun-16 3:37 
AnswerRe: Google MAP with Multiple Marked location Pin
Richard MacCutchan3-Jun-16 4:15
mveRichard MacCutchan3-Jun-16 4:15 
AnswerRe: Google MAP with Multiple Marked location Pin
ZurdoDev3-Jun-16 4:39
professionalZurdoDev3-Jun-16 4:39 
QuestionBest alternative for web automation in Internet Explorer Pin
IT - Researcher24-May-16 23:42
IT - Researcher24-May-16 23:42 
QuestionAngularJS controller is not firing, in ASP.NET MVC and AngularJS application Pin
indian14323-May-16 22:17
indian14323-May-16 22:17 
AnswerRe: AngularJS controller is not firing, in ASP.NET MVC and AngularJS application Pin
Nathan Minier24-May-16 1:28
professionalNathan Minier24-May-16 1:28 
GeneralRe: AngularJS controller is not firing, in ASP.NET MVC and AngularJS application Pin
indian14324-May-16 7:05
indian14324-May-16 7:05 
Hi,

I did implement that, it resolved one problem, but when I am trying to debug the code in the ASP.Net MVC controller, I am getting the following error.

My ASP.Net Controller is as below
namespace TestAngularJSApplication.Controllers
{
    public class EmployeeController : Controller
    {<br />
        public ActionResult Index()
        {
            return View();
        }

        public JsonResult GetEmployees()
        {
            DAL oDAL = new DAL();
            //List<Employee> listOfEmployees;
            var a = oDAL.employees;
            var listOfEmployees = oDAL.employees.ToList();
            return Json(listOfEmployees,JsonRequestBehavior.AllowGet);
        }
    }
}
And my DAL is as below
public class DAL : DbContext
{
    public DAL() : base("TestConnectionString") { }

    public DbSet<Employee> employees { get; set; }

    protected override void OnModelCreating(DbModelBuilder modelBuilder)
    {
        //base.OnModelCreating(modelBuilder);
        modelBuilder.Entity<Employee>().ToTable("EmployeeTable");
        modelBuilder.Entity<Employee>().HasKey(x => x.Id);
    }
}

And Database table structure is as below
CREATE TABLE [dbo].[EmployeeTable](
    [Id] [int] IDENTITY(1,1) NOT NULL,
    [Name] [nvarchar](max) NULL,
    [EmployeeAddress] [nvarchar](max) NULL,
    [EmployeeSalary] [decimal](10, 2) NULL,
    [IsActive] [bit] NULL,
 CONSTRAINT [PK_EmployeeTable] PRIMARY KEY CLUSTERED 
(
    [Id] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]

And class structure is as below
namespace TestAngularJSMCVApplication.Models
{
    public class Employee
    {
        public int Id { get; set; }
        public string Name { get; set; }
        public string EmployeeAddress { get; set; }
        public decimal EmpployeeSalary { get; set; }
        public bool IsActive { get; set; }
    }
}

And the database table that I am trying to load and show in the View, is not being loaded. Any help please. I think the new Entity Framework is changed little bit from the old one.
Any sort of help helps me a lot. Thanks in advance.
Thanks,

Abdul Aleem

"There is already enough hatred in the world lets spread love, compassion and affection."


modified 24-May-16 16:51pm.

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.