Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>At first, if you are comfortable with Java try the Spring MVC. There are a lot of tutorial regarding this. If you are much more confident in C# try ASP .NET MVC 3. I will prefer the later one as in this case you have to deal with less configuration.</p> <p>Now I will answer your question one by one.</p> <p>At first create a model for every table in your database. Actually these models (which are nothing but classes) when instantiated are nothing but an individual row of the respective table. Your ORM (object relational mapping) tool (For java you can use hibernate, for c#.net you can use entity framework) will provide you specific methods (save(object), add(object), delete(object)) for updating the database</p> <p>Now each controller should work with a specific model (Here I am ignoring the complexities of using multiple models.). But it may generate numerous views. By clicking a link in your view page you actually invoke the related method in the controller. The controller than binds the Data (if any) with the specific view realted to that link and then the view is rendered. So for deleting a row there should be a method named delete() (you may name it anything you want, so dont be confused) in your controller. When you want to delete a row invoke that method and inside the method remove that row by using something like delete(object) (these methods will be provided by your ORM) and then return another view. The same thing is applied for adding and updating data. But each method may generate different views. Its upto you that which view you return in each of these methods.</p> <p>I hope the answer helps you. Cheers !!!</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. COThanks for your answer. I know there are some framework that can handle this. But I wanna know how it does that. I want to learn it from scratch so that i could understand it perfectly. Lemme rephrase this, so i do have to construct many models (objects) that represent each rows of the table? And there is only one controller that controls the collection of those models? And there is also only one view that shows the values?
      singulars
    2. COSuppose you are developing a student database application. So there will be a table for student's information. Create a model for student. This model (class will contain some attributes like name, year, session etc.) So when you want to add a student you have instantiate this model class that is create an object and simply add it to the database. So yes actually you can consider each row of your database as an individual object.
      singulars
    3. CONow write a controller for this model class. If I was wrtiting the code I would named it StudentController. Write a method named Index inside it. Now when the application will begin it will obviously display a homepage. For that write a HomeController. You have to write it in your configuration that which controller will be loaded at startup. Now inside that HomeController create a method named index and return a view from there. Now in that view place a link to see the student details page. By clicking the link invoke the Index method of the StudentController
      singulars
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload