/* */

Hello World Example for MVC

Here i am gonna write a very basic app using MVC .
1)First as like other App . Open Visual Studio Add a new Project
2)The moment you are done with adding a project . You will see some folders like Controller ,Model ,View .

3)Bottom line Controllers are the class where ou implement logic,
4)View :PLace where your aspx or cshtml or things relevent to design will be placed.
5)Model is  a normal class where you will represent your data type and implement the oops concept mostly.

Coming back to the point:
Here i will show a example where you can see the Current datetime.
For that you need to add a controller  class :



In Controller you can click on method name and add a view .





After that inside the view which is added automatically by following the above steps. You Can add your line of text 

 This is out First MVC<br />
        The Current Time is <%=ViewData["CurrentTime"] %>





And then check the final result. 

Previous
Next Post »
Thanks for your comment