Node is saved as draft in My Content >> Draft
-
Partial View in MVC
When we want to use piece of code again and again and want to make it reusable throughout the application we will make it a partial view.
Partial view is like user control in a normal web application that is created and placed anywhere in the page.
You can create a controller and after that you can create an event and when you add a view for that event you can make it as a partial view.
@model PartialViewSample.Models.Product
@{
Layout = null;
}
<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="width=device-width" />
<title>AddProduct</title>
</head>
<body>
<div>
<label>Id:</label>
@Html.TextBox("Id", Model.Id)
<label>Name:</label>
@Html.TextBox("Name", Model.Id)
<label>Description:</label>
@Html.TextBox("Description", Model.Description)
<label>Quantity:</label>
@Html.TextBox("Quantity", Model.Quantity)
</div>
</body>
</html>
After creating this you can create any event and associate with this view for reusing it.
0 Comment(s)