: Model.
ViewBag. ViewBag . :
public ActionResult About()
{
ViewBag.Name = " 1.";
return View();
}
HTML :
<div>@ViewBag.Name</div>
View:
public ActionResult Details(int id)
{
Vacancy v =........ //
return View(v);
}
..
public class Vacancy
{
public int Id { get; set; }
public string Name { get; set; }
}
Model:
Model Vacancy
....
....
....
<div> @Model.Name </div>
, , HTML-.
@using (Html.BeginForm("Create", "Vacancy", FormMethod.Post, new { enctype = "multipart/form-data" }))
{
<input type="text" name="Name" id="Name"/>
<input class="inputImg" type="submit" id="btnSendFeedback" value="">
}
-:
[HttpPost]
public ActionResult Create(Vacancy pr)
{
if (ModelState.IsValid)
{
StringBuilder str = new StringBuilder();
.............
str.AppendLine(pr.Name);
............
return RedirectToAction("Success");
}
return View(pr);
}
..
public class Vacancy
{
public string Name { get; set; }
}
ASP.NET MVC , .
, 1, ASP.NET MVC web application. DomainModel ( 1).
----.
.
Index, ( ).
Details.
Create.
Edit.
CRUD ( , , , ). .
:
|
|
1.
2.
a. , Use-case
b. -
c.
3.
4.
1. ? ?
2. HTTP , - ?
3. Visual Studio ()?
1. " "
2. ASP.NET MVC // MSDN URL: https://msdn.microsoft.com/ru-ru/library/dd381412(v=vs.108).aspx ( : 09.05.2016).
3. HTML 5 // W3C Schools URL: http://www.w3schools.com ( : 09.05.2016).
4. ASP.NET MVC. 0. // Hbrahabr URL: https://habrahabr.ru/post/175999/ ( : 09.05.2016).