Skip to content

Instantly share code, notes, and snippets.

@corespider
Created September 18, 2020 11:10
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save corespider/f7b439745bfdf82e8dfbab5b8df820d6 to your computer and use it in GitHub Desktop.
Save corespider/f7b439745bfdf82e8dfbab5b8df820d6 to your computer and use it in GitHub Desktop.
ViewData Example
<html>
<head>
<meta name="viewport" content="width=device-width" />
<title>Customer Management</title>
<script src="~/lib/jquery/jquery.js"></script>
<link href="~/lib/twitter-bootstrap/css/bootstrap.css" rel="stylesheet" />
</head>
<body>
@{
var customer = ViewData["Customer"] as CustomerManagement.Models.Customer;
}
<div class="container">
<h2>Page Title is : @ViewData["Title"] </h2>
<table class="table table-dark">
<tr>
<td>
Customer Id
</td>
<td>
@customer.custid
</td>
</tr>
<tr>
<td>
Name
</td>
<td>
@customer.name
</td>
</tr>
<tr>
<td>
Address
</td>
<td>
@customer.address
</td>
</tr>
<tr>
<td>
Phone
</td>
<td>
@customer.phone
</td>
</tr>
<tr>
<td>
Email
</td>
<td>
@customer.email
</td>
</tr>
<tr>
<td>
Gender
</td>
<td>
@customer.gender
</td>
</tr>
</table>
</div>
</body>
</html>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment