how to pass a value from a view to a controller

Posted by mohammedr88-18313 under ASP.NET MVC on 11/26/2013 | Points: 10 | Views : 1021 | Status : [Member] | Replies : 2
Hi all

i want to pass a value to below controller id=10, anyoff help how to do thanks in advance


public ViewResult Show(int id)
{
var entry = _db.Entries.Find(id);
ViewBag.Name = entry.Name;
}




Responses

Posted by: vishalneeraj-24503 on: 11/26/2013 [Member] [MVP] Platinum | Points: 25

Up
0
Down
Please refer below links:-
http://www.codeproject.com/Articles/639709/Getting-Data-From-View-to-Controller-in-MVC
http://www.c-sharpcorner.com/UploadFile/abhikumarvatsa/various-ways-to-pass-data-from-controller-to-view-in-mvc/
http://stackoverflow.com/questions/5585081/how-to-pass-value-from-view-to-controller
http://stackoverflow.com/questions/12954806/how-to-pass-a-textbox-value-from-view-to-a-controller-in-mvc-4
http://stackoverflow.com/questions/18608452/mvc-4-how-pass-data-correctly-from-controller-to-view
http://bubblogging.wordpress.com/2011/12/31/mvc-data-controller-view/


mohammedr88-18313, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: vishalneeraj-24503 on: 11/26/2013 [Member] [MVP] Platinum | Points: 25

Up
0
Down
Hi, you can also refer below links:-
http://oleb.net/blog/2012/02/passing-data-between-view-controllers/
http://www.youtube.com/watch?v=le5Meyjlhi8

Hope this will help you.

mohammedr88-18313, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response