TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Vidhi Patel
NA
44
17.7k
Not retry grid data from database use entity framework
Sep 15 2016 7:28 AM
my controller:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.Mvc;
namespace MyWealthFirst.Controllers
{
public class HomeController : Controller
{
//
// GET: /Home/
WTAutoEntities1 e = new WTAutoEntities1();
public ActionResult Home()
{
return View();
}
public ActionResult About()
{
return View("");
}
public ActionResult Details()
{
return View(e.Companies.ToList());
}
}
}
cshtml page code:
@model MyWealthFirst.Company
@{
ViewBag.Title = "Details";
Layout = "~/Views/Shared/_LayoutPage.cshtml";
}
<h2>Details</h2>
<fieldset>
<legend>Company</legend>
<div class="display-label">
@Html.DisplayNameFor(model => model.cName)
</div>
<div class="display-field">
@Html.DisplayFor(model => model.cName)
</div>
<div class="display-label">
@Html.DisplayNameFor(model => model.Arn)
</div>
<div class="display-field">
@Html.DisplayFor(model => model.Arn)
</div>
<div class="display-label">
@Html.DisplayNameFor(model => model.address)
</div>
<div class="display-field">
@Html.DisplayFor(model => model.address)
</div>
<div class="display-label">
@Html.DisplayNameFor(model => model.street)
</div>
<div class="display-field">
@Html.DisplayFor(model => model.street)
</div>
<div class="display-label">
@Html.DisplayNameFor(model => model.area)
</div>
<div class="display-field">
@Html.DisplayFor(model => model.area)
</div>
<div class="display-label">
@Html.DisplayNameFor(model => model.city)
</div>
<div class="display-field">
@Html.DisplayFor(model => model.city)
</div>
<div class="display-label">
@Html.DisplayNameFor(model => model.pincode)
</div>
<div class="display-field">
@Html.DisplayFor(model => model.pincode)
</div>
<div class="display-label">
@Html.DisplayNameFor(model => model.state)
</div>
<div class="display-field">
@Html.DisplayFor(model => model.state)
</div>
<div class="display-label">
@Html.DisplayNameFor(model => model.phone1)
</div>
<div class="display-field">
@Html.DisplayFor(model => model.phone1)
</div>
<div class="display-label">
@Html.DisplayNameFor(model => model.phone2)
</div>
<div class="display-field">
@Html.DisplayFor(model => model.phone2)
</div>
<div class="display-label">
@Html.DisplayNameFor(model => model.mobile)
</div>
<div class="display-field">
@Html.DisplayFor(model => model.mobile)
</div>
<div class="display-label">
@Html.DisplayNameFor(model => model.fax)
</div>
<div class="display-field">
@Html.DisplayFor(model => model.fax)
</div>
<div class="display-label">
@Html.DisplayNameFor(model => model.PAN)
</div>
<div class="display-field">
@Html.DisplayFor(model => model.PAN)
</div>
<div class="display-label">
@Html.DisplayNameFor(model => model.eMail)
</div>
<div class="display-field">
@Html.DisplayFor(model => model.eMail)
</div>
</fieldset>
<p>
@Html.ActionLink("Edit", "Edit", new { id=Model.Id }) |
@Html.ActionLink("Back to List", "Index")
</p>
Reply
Answers (
1
)
Creation of folder and uploading files in folder
in asp.net mvc speak Text button click