CREATE A ASP.NET MVC SIMPLE PROGRAM USING C#
SELECT BASIC TEMPLATE
ADD CONTROLLER IN CONTROLLER FOLDER
=> AND NAME AS HOMECONTROLLER.CS
HOMECONTROLLER.CS
----------------------------------------
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
namespace DefaultMVCprogram.Controllers
{
public class HomeController : Controller
{
public ActionResult Index()
{
return View();
}
public ActionResult AboutUs()
{
return View();
}
public ActionResult ContactUs()
{
return View();
}
public ActionResult Courses()
{
return View();
}
}
}
=>ADD RIGHT CLICK ON VIEW AND ADD VIEW
INDEX.CSHTML
................................
<h1>Welcome To Our institude</h1>
<hr />
<a href="/Home/AboutUs">About Us</a>
<br />
<a href="/Home/ContactUs">Contact Us</a>
<br />
<a href="/Home/Courses">Courses</a>
=>CONTACTUS.CSHTML
.........................................
<h1>Contact Us</h1>
<hr />
<a href="/Home/Index">Back To Index</a>
=>ABOUTUS.CSHTML
........................................
<h1>Abous Us</h1>
<hr />
<a href="/Home/Index">Back To Index</a>
=>COURSES.CSHTML
................................................
<h1>Courses</h1>
<hr />
<ul>
<li>ASP</li>
<li>ASP.NET</li>
<li>ASP.NET MVC</li>
</ul>
<hr />
<a href="/Home/Index">Back To Index</a>
ADD CONTROLLER IN CONTROLLER FOLDER
=> AND NAME AS HOMECONTROLLER.CS
HOMECONTROLLER.CS
----------------------------------------
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
namespace DefaultMVCprogram.Controllers
{
public class HomeController : Controller
{
public ActionResult Index()
{
return View();
}
public ActionResult AboutUs()
{
return View();
}
public ActionResult ContactUs()
{
return View();
}
public ActionResult Courses()
{
return View();
}
}
}
=>ADD RIGHT CLICK ON VIEW AND ADD VIEW
INDEX.CSHTML
................................
<h1>Welcome To Our institude</h1>
<hr />
<a href="/Home/AboutUs">About Us</a>
<br />
<a href="/Home/ContactUs">Contact Us</a>
<br />
<a href="/Home/Courses">Courses</a>
=>CONTACTUS.CSHTML
.........................................
<h1>Contact Us</h1>
<hr />
<a href="/Home/Index">Back To Index</a>
=>ABOUTUS.CSHTML
........................................
<h1>Abous Us</h1>
<hr />
<a href="/Home/Index">Back To Index</a>
=>COURSES.CSHTML
................................................
<h1>Courses</h1>
<hr />
<ul>
<li>ASP</li>
<li>ASP.NET</li>
<li>ASP.NET MVC</li>
</ul>
<hr />
<a href="/Home/Index">Back To Index</a>
Comments
Post a Comment