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!
Sasi ReddyPosted Aug 21, 2014, 11:37 PM
@{
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);
}
OmarPosted Aug 21, 2014, 2:12 PM
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.
OmarPosted Aug 21, 2014, 11:02 AM
Ramesh MaruthiPosted Aug 21, 2014, 10:48 AM
Dont know this helps a little bit or not but look at this link once
http://www.dotnetcurry.com/showarticle.aspx?ID=655
OmarPosted Aug 21, 2014, 10:08 AM
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) ?
Sasi ReddyPosted Aug 21, 2014, 9:59 AM