I have an Infragistics gridview in one of my views (ViewLeads). I have another view (updateLead) that has a bunch of textboxes. What I want is when I click one of the rows in the gridView (in the ViewLeads View), for it to display all the same data in the corresponding textboxes in the other view (updateLead) for that specific ID of the selected row.
Right now when I click the name it just returns the empty view, with no data.
.
.
[HttpGet]
public ActionResult UpdateLead()
{
LoginUser user = Session["User"] as LoginUser;
if (user != null)
{
return View();
}
return RedirectToAction("Login", "Main");
}
I'm pretty new to MVC so I'm really stuck right now. Thank you!

Omar14 reputationPosted Aug 21, 2014, 7:02 AM EDT
Sasi ReddyRank #4,458 · 342 reputationPosted Aug 21, 2014, 7:37 PM EDT
@{
var grid = new WebGrid(Model, canPage: true, rowsPerPage:5,
selectionFieldName: "selectedRow",ajaxUpdateContainerId: "gridContent");
grid.Pager(WebGridPagerModes.NextPrevious);}
@grid.GetHtml(tableStyle: "webGrid",
headerStyle: "header",
alternatingRowStyle: "alt",
selectedRowStyle: "selectedrow",
columns: grid.Columns(
grid.Column("Location Code",format: @
grid.Column("Edit", format: @
grid.Column("Delete", format: @
))
the controller should be like this
public ActionResult Edit(int id = 0)
{
LOCATION_MASTER location = db.LOCATION_MASTER.Find(id);
LOCATION_MASTER location_master = db.LOCATION_MASTER.Find(id);
if (location_master == null)
{
return HttpNotFound();
}
return View(location_master);
}
Sasi ReddyRank #4,458 · 342 reputationPosted Aug 21, 2014, 5:59 AM EDT
Omar14 reputationPosted Aug 21, 2014, 6:08 AM EDT
Right now the view looks like
@Html.TextBoxFor(model => model.Name, new { @class = "form-control" })
@Html.TextBoxFor(model => model.Email, new { @class = "form-control" })....etc
So shouldt I be able to write something like this in my controller
[Http Get]
return view(name of viewModel) ?
Ramesh MaruthiRank #937 · 2.2K reputationPosted Aug 21, 2014, 6:48 AM EDT
Dont know this helps a little bit or not but look at this link once
http://www.dotnetcurry.com/showarticle.aspx?ID=655
Omar14 reputationPosted Aug 21, 2014, 10:12 AM EDT
I have a view 'UpdateLead'
on the GET I have..
SO when I see the View, the 'name' field has text "some stuff"..
but what i want is basically to get that name information from a gridview that is on another view called 'ViewLeads'. I'm totally lost right now.