Hi ahsan.ali,
Check this example. Now please take its reference and correct your code.
Database
For this example I have used of NorthWind database that you can download using the link given below.
Download Northwind Database
Controller
public class HomeController : Controller
{
// GET: /Home/
public ActionResult Index()
{
NorthwindEntities entities = new NorthwindEntities();
return View(entities.Products.ToList().FirstOrDefault());
}
}
View
<%@ Page Language="C#" Inherits="System.Web.Mvc.ViewPage<_141945_TextBoxFor_Format.Product>" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title>Index</title>
<link rel="stylesheet" href="http://maxcdn.bootstrapcdn.com/bootstrap/3.3.2/css/bootstrap.min.css" />
</head>
<body>
<table class="table table-bordered">
<tr>
<th>
ProductID
</th>
<th>
ProductName
</th>
<th>
UnitPrice
</th>
</tr>
<tr>
<td>
<%: Model.ProductID %>
</td>
<td>
<%: Model.ProductName%>
</td>
<td>
<%: Html.TextBoxFor(model=>model.UnitPrice, new { placeholder = "UnitPrice", Value = String.Format("{0:N2}", Model.UnitPrice), @class = "form-control DocumentField", @readonly = "readonly" })%>
</td>
</tr>
</table>
</body>
</html>
Screenshot
