Click here to Skip to main content
15,886,258 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi All, I need to pass data from controller to view. In my page multiple images and button's are there. Every image have one button, and every image have 4 fields of data

like field 1 : data,
field 2: data,
etc...

If i click button i need to send that information to another page. How it will do that? Please help me on that.


Thanks
krishna
Posted
Updated 28-Jul-14 21:24pm
v2

1 solution

Create multiple partial views for each image and button you can place the button in the partial view or just set it on you index/home page .Using ajax post you can and @html.renderparcial you can then call it on another page on button click function using a javascript method
https://www.youtube.com/watch?v=SABg7RyjX-4
the above video will show u exactly how to use partial views

https://www.youtube.com/watch?v=GrycH6F-ksY
the second video will show u how to use forms and post with ajax

once you’ve got that figured out all you have to do is create javascript methods to call the onclick functions
javascript onclick functions (please note calling a button u need to refer to the button id for the onclick to work),then each method if 4 buttons ul have 4 methods that will use ajax post to redirect the parcial view to a new page
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900