Thursday, August 15, 2013

MVC SAMPLE 5(Working with file upload )

File ->New ->Project


Select  the project Template


And Click on Ok
And go to controller Right click on it and select ADD Controller


Give the name of the controller


And then create a folder with name as   “Docs”




And paste any pdf file in Docs

And then go to Demo Controller and write the following Code



Here dotnetadvertising.pdf is the name of the file which is there is there in Docs Folder.


And then Right click on the screen and select Add View



And then run the Program
Demo: is the name of the controller
GetDoc  is the name of the method name


And then the file gets download automatically as


MVC Sample 4(Working with View Bag)

File->new ->Project


Project Template


And click on Ok Button.
And go to controller Right click on it and select ADD Controller



Give the name of the controller



And click on Add, Then write the following Code.



And then Right Click on the Page and select    Add View





And click on Add and write the following Code

And click on Add and write the following Code


And run the program and see the output


Sunday, August 11, 2013

MVC Sample 3

Writing one more method to call the same View


And Click on Ok Button.
Select Internet Application and Click on Ok Button.


Go to controller and Right click on controller Folder and Add Controller


And write the following code


Now Right Click on the Page and Add View



View Name: Show
And Click on Add, and now the View is Created.
Demo: is the name of the controller
Show is the method name.
View2 is the method name

MVC Sample 2

File->New->Project


Select Project Template as

Internet Application


And Click on Ok Button

And Go to Controller Folder and Right Click  àAddController.


Now in DemoController ,write the following Code.

Now, write click on Demo Controller .cs(that is exactly on ViewResult)

Click on AddView


View Name: Show
And Click on Add, and now the View is Created.
Demo:is the name of the controller

Show is the method name.

MVC Sample 1



File ->New->Project
Note: Always select project when working with mvc (there is no option to work with file->new ->website) in MVC


Another Window will be displayed asking for the type of MVC Application we want to create


Select Empty and click on Ok
Now the solution Explorer will be 

Now Right Click on Controller -àAdd
Name of the controllerà




Controller Name: DemoController
Template : Empty MVC Controller and click on Add



Now Run the program

Demo is the name of the controller and Welcome is the method name


In mvc request should always go from controller and controller responded back.

Kubernetes

Prerequisites We assume anyone who wants to understand Kubernetes should have an understating of how the Docker works, how the Docker images...