Do I have to add the ID to the Create Controller, and if so, my mobile nav logic is different from my web logic. So do I make another action to represent the mobile method call, like: (but causes and error
public ActionResult Createm(int id)
{
FavAct createlog = db.FavActs.Find(id);
ViewBag.DistanceID = new SelectList(db.Distances, "DistanceID", "DistanceName");
ViewBag.IntensityID = new SelectList(db.Intensities, "IntensityID", "IntensityName");
ViewBag.StudentID = new SelectList(db.Students, "StudentID", "FirstName");
return View();
scott_t_ct
Member
45 Points
34 Posts
mvc 3 jquery mobile: passing id to a form element through an action link inside a Listview
Jan 07, 2012 04:36 PM|LINK
<ul data-role="listview" data-filter="true"> @foreach (var favact in Model.ToList()) { <li> <img src="@Url.Content("~/" + favact.act.Type.ImageURL)" alt="@Url.Content(favact.act.Type.Name)" id="LogActthumbnail" style="padding-left: 15px" /> @Html.ActionLink(favact.act.Description , "Createm", "Log",new { id = favact.ActID }) <p style="padding-left: 15px">METS = @favact.act.METS </p> </li> } </ul>Do I have to add the ID to the Create Controller, and if so, my mobile nav logic is different from my web logic. So do I make another action to represent the mobile method call, like: (but causes and error
public ActionResult Createm(int id) { FavAct createlog = db.FavActs.Find(id); ViewBag.DistanceID = new SelectList(db.Distances, "DistanceID", "DistanceName"); ViewBag.IntensityID = new SelectList(db.Intensities, "IntensityID", "IntensityName"); ViewBag.StudentID = new SelectList(db.Students, "StudentID", "FirstName"); return View();This causes a script error on the controller.
Anindita.Bas...
Contributor
2448 Points
416 Posts
Re: mvc 3 jquery mobile: passing id to a form element through an action link inside a Listview
Jan 09, 2012 02:19 PM|LINK
Not sure whether you are getting JScript Runtime error. Check out the @Url.Content method for passing the links.
Check some tutorials for reference :
http://weblogs.asp.net/shijuvarghese/archive/2011/02/25/mobile-enabled-web-apps-with-asp-net-mvc-3-and-jquery-mobile.aspx
http://www.codeproject.com/Articles/164088/Using-jQuery-Mobile-with-ASP-NET-MVC
http://anindita9.wordpress.com/2011/12/05/asp-net-mvc-razor-template-jquery-mobile-web-for-android-windows-phone-blackberry/
Thanks,
Anindita
http://anindita9.wordpress.com