I am in the process of learning Entity Framework 6. I am looking for a tutorial explaining how to setup an ASP.NET Web Forms site (not ASP.NET MVC) and create basic CRUD pages. The only tutorials I can find are based on MVC and/or Console Apps rather than web application.
I am familiar with MVC but I do not want to use MVC for this project. Entity Framework 6 webforms only. All tutorials seem to be based on MVC or they step you through creating a Console App rather than a Web App.
An example of what I am running into is trying to add a simple gridview to a webform page.
It seems this should be a simple procedure but I have not found the code to make it work yet. I think I must be missing a simple step. The page has a gridview named Gridview1. In the code behind I am using:
namespace EFTestSchool.Models
{
public partial class WebForm1 : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
Student db = new Student();
GridView1.DataSource
}
}
}
When I add the .Models to the namespace, it says that the Gridview1 cannot be found. When I use the namespace as simply EFTestSchool, the Gridview1 is recognized but my line Student db = New Student() says Student cannot be found. The name of my project is EFTestSchool. The name of my model is SchoolModel. This is based on the standard School database used in some tutorials. I must be missing something very simple that is preventing me from adding a simple grid to a webform page.
Any suggestions would be appreciated.