Passing data from Controller to View

Viewdata/Viewbag/Tempdata is used to pass data from CONTROLLER to VIEW.
By seeing the picture,you can understand how data is passed from controller to view.
Passing Data from Controller to View:-
Let us do it Step by Step:-
Step 1: Create a new project named "ControllerToView" in Visual studio 2015

Step 2: Select MVC template

Step 3:You will see the following image.

Step 4:Now Add "MySiteController" to controller folder

Step 5:Go to Route.config file in App_Start folder
Step 6:Change the default route to "MySite" as below

name: "Default",
url: "{controller}/{action}/{id}",
defaults: new { controller = "MySite", action = "Index", id = UrlParameter.Optional }

Step 7:Modify the controller to Store the data to be displayed in view.
public ActionResult Index()
ViewBag.mysitename = "";
ViewBag.myyoutubelink = "";
ViewBag.myinstagramlink = "";
return View();

Step 8: Now add View by right click of View() in Index().

Step 9:Modify the view part as below:-
<div style="text-align:center;border:1px solid red">
<h1>MySite - ViewBag Example<h1>
<br >
<td>Site Name:<td>
<td id="t1">@ViewBag.mysitename<td>
<td>Youtube Name:<td>
<td id="t2">@ViewBag.myyoutubelink<td>
<td id="t3">@ViewBag.myinstagramlink<td>
Step 10: Run the code, Your output will be like the below screen