I have a value price in a span in my view file and i want to pass the value of that span to my controller without submitting a form, is there a way to do this?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Yes you can use something like AJAX. However you are thinking about this all wrong, you are not passing from a VIEW => CONTROLLER, you are still doing user submission, and just managing that input.
So you would do a controller LIKE a standard form submit, you could use jQuery to get you there by using its
.ajax()function:Reference: http://docs.jquery.com/API/1.1/AJAX