Categories:
.NET (357)
C (330)
C++ (183)
CSS (84)
DBA (2)
General (7)
HTML (4)
Java (574)
JavaScript (106)
JSP (66)
Oracle (114)
Perl (46)
Perl (1)
PHP (1)
PL/SQL (1)
RSS (51)
Software QA (13)
SQL Server (1)
Windows (1)
XHTML (173)
Other Resources:
What is MVC pattern
How can you implement MVC pattern in ASP.NET?
✍: Guest
The main purpose using MVC pattern is to decouple the GUI from the Data. It also gives
the ability to provide multiple views for the same Data. MVC pattern separates objects in
to three important sections:-
ã Model: - This section is specially for maintaining data. It is actually where your
business logic, querying database, database connection etc. is actually
implemented.
ã Views: - Displaying all or some portion of data, or probably different view of
data. View is responsible for look and feel, Sorting, formatting etc.
ã Controller: - They are event handling section which affects either the model or
the view. Controller responds to the mouse or keyboard input to command
model and view to change. Controllers are associated with views. User
interaction triggers the events to change the model, which in turn calls some
methods of model to update its state to notify other registered views to refresh
their display.
Ok now this was all in theory. Let us look at how in actually ASP.NET we can implement
MVC pattern. During interview with theory question they will be looking at have you
really implemented MVC or its just talks. Following are the various sections of ASP.NET
which maps to MVC sections:-
ã Model: - This section is represented by Data view, Dataset, Typed Dataset,
Business components, business entity models etc. Now this section can then
be tied up to either windows application or web UI.
ã View: - ASPX, ASCX, or windows application UI like data grid etc. form the
view part of it.
ã Controller: - In ASP.NET the behind code is the controller as the events are
handled by that part. Controller communicates both with Model as well as
view.
I hope I was able to map you imagination of ASP.NET with the diagram given below.
2007-10-24, 11478👍, 0💬
Popular Posts:
How To Get the Minimum or Maximum Value of an Array? - PHP Script Tips - PHP Built-in Functions for ...
.NET INTERVIEW QUESTIONS - Where do you specify session state mode in ASP.NET ? The following code e...
WHat will be the result of the following code? #define TRUE 0 // some code while (TRUE) { // some co...
Rachel opened her math book and found that the sum of the facing pages was 245. What pages did she o...
What is DAR (Decision Analysis and Resolution) ? Decision Analysis and Resolution is to analyze poss...