{"id":235586,"date":"2024-06-20T07:38:59","date_gmt":"2024-06-20T07:38:59","guid":{"rendered":"https:\/\/namso-gen.co\/blog\/?p=235586"},"modified":"2024-06-20T07:38:59","modified_gmt":"2024-06-20T07:38:59","slug":"how-to-pass-value-from-view-to-controller-in-mvc","status":"publish","type":"post","link":"https:\/\/namso-gen.co\/blog\/how-to-pass-value-from-view-to-controller-in-mvc\/","title":{"rendered":"How to pass value from view to controller in MVC?"},"content":{"rendered":"<p>In the Model-View-Controller (MVC) architecture, the view represents the user interface, the controller processes user input, and the model manages the application&#8217;s data and business logic. One common task in MVC development is passing data from the view to the controller. This allows user input or selected values in the view to be sent back to the controller for further processing. There are several ways to achieve this in MVC frameworks like ASP.NET MVC or Laravel.<\/p>\n<p><strong>One way to pass value from view to controller in MVC is through form submissions. By creating a form in the view and posting the data to a controller action, the values entered by the user can be accessed in the controller.<\/strong><\/p>\n<p>Here is a step-by-step guide on how to pass value from view to controller using form submissions in ASP.NET MVC:<\/p>\n<p>1. Create a form in the view using the HTML `<\/p>\n<form>` element.<br \/>\n2. Add input fields within the form for the user to enter data.<br \/>\n3. Specify the action and method attribute of the form to point to a controller action and define the HTTP method (e.g., POST).<br \/>\n4. In the controller, create an action method that matches the form&#8217;s action attribute.<br \/>\n5. Use model binding to map the form data to parameters of the action method.<br \/>\n6. Process the data in the controller action and perform necessary operations.<\/p>\n<p>By following these steps, data entered by the user in the view can be passed to the controller for handling.<\/p>\n<div id=\"ez-toc-container\" class=\"ez-toc-v2_0_62 counter-hierarchy ez-toc-counter ez-toc-grey ez-toc-container-direction\">\n<div class=\"ez-toc-title-container\">\n<p class=\"ez-toc-title \" >Table of Contents<\/p>\n<span class=\"ez-toc-title-toggle\"><a href=\"#\" class=\"ez-toc-pull-right ez-toc-btn ez-toc-btn-xs ez-toc-btn-default ez-toc-toggle\" aria-label=\"Toggle Table of Content\"><span class=\"ez-toc-js-icon-con\"><span class=\"\"><span class=\"eztoc-hide\" style=\"display:none;\">Toggle<\/span><span class=\"ez-toc-icon-toggle-span\"><svg style=\"fill: #999;color:#999\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" class=\"list-377408\" width=\"20px\" height=\"20px\" viewBox=\"0 0 24 24\" fill=\"none\"><path d=\"M6 6H4v2h2V6zm14 0H8v2h12V6zM4 11h2v2H4v-2zm16 0H8v2h12v-2zM4 16h2v2H4v-2zm16 0H8v2h12v-2z\" fill=\"currentColor\"><\/path><\/svg><svg style=\"fill: #999;color:#999\" class=\"arrow-unsorted-368013\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" width=\"10px\" height=\"10px\" viewBox=\"0 0 24 24\" version=\"1.2\" baseProfile=\"tiny\"><path d=\"M18.2 9.3l-6.2-6.3-6.2 6.3c-.2.2-.3.4-.3.7s.1.5.3.7c.2.2.4.3.7.3h11c.3 0 .5-.1.7-.3.2-.2.3-.5.3-.7s-.1-.5-.3-.7zM5.8 14.7l6.2 6.3 6.2-6.3c.2-.2.3-.5.3-.7s-.1-.5-.3-.7c-.2-.2-.4-.3-.7-.3h-11c-.3 0-.5.1-.7.3-.2.2-.3.5-.3.7s.1.5.3.7z\"\/><\/svg><\/span><\/span><\/span><\/a><\/span><\/div>\n<nav><ul class='ez-toc-list ez-toc-list-level-1 ' ><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-1\" href=\"https:\/\/namso-gen.co\/blog\/how-to-pass-value-from-view-to-controller-in-mvc\/#FAQs_on_passing_value_from_view_to_controller_in_MVC\" title=\"FAQs on passing value from view to controller in MVC:\">FAQs on passing value from view to controller in MVC:<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-2\" href=\"https:\/\/namso-gen.co\/blog\/how-to-pass-value-from-view-to-controller-in-mvc\/#1_Can_data_be_passed_from_a_view_to_a_controller_without_using_form_submissions\" title=\"1. Can data be passed from a view to a controller without using form submissions?\">1. Can data be passed from a view to a controller without using form submissions?<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-3\" href=\"https:\/\/namso-gen.co\/blog\/how-to-pass-value-from-view-to-controller-in-mvc\/#2_What_is_model_binding_in_MVC\" title=\"2. What is model binding in MVC?\">2. What is model binding in MVC?<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-4\" href=\"https:\/\/namso-gen.co\/blog\/how-to-pass-value-from-view-to-controller-in-mvc\/#3_Can_view_components_communicate_directly_with_the_controller_in_MVC\" title=\"3. Can view components communicate directly with the controller in MVC?\">3. Can view components communicate directly with the controller in MVC?<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-5\" href=\"https:\/\/namso-gen.co\/blog\/how-to-pass-value-from-view-to-controller-in-mvc\/#4_How_can_dropdown_values_be_passed_from_a_view_to_a_controller\" title=\"4. How can dropdown values be passed from a view to a controller?\">4. How can dropdown values be passed from a view to a controller?<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-6\" href=\"https:\/\/namso-gen.co\/blog\/how-to-pass-value-from-view-to-controller-in-mvc\/#5_Is_it_possible_to_pass_complex_objects_from_a_view_to_a_controller\" title=\"5. Is it possible to pass complex objects from a view to a controller?\">5. Is it possible to pass complex objects from a view to a controller?<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-7\" href=\"https:\/\/namso-gen.co\/blog\/how-to-pass-value-from-view-to-controller-in-mvc\/#6_What_are_TempData_and_ViewBag_in_ASPNET_MVC\" title=\"6. What are TempData and ViewBag in ASP.NET MVC?\">6. What are TempData and ViewBag in ASP.NET MVC?<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-8\" href=\"https:\/\/namso-gen.co\/blog\/how-to-pass-value-from-view-to-controller-in-mvc\/#7_How_can_multiple_values_be_passed_from_a_view_to_a_controller\" title=\"7. How can multiple values be passed from a view to a controller?\">7. How can multiple values be passed from a view to a controller?<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-9\" href=\"https:\/\/namso-gen.co\/blog\/how-to-pass-value-from-view-to-controller-in-mvc\/#8_Can_hidden_fields_be_used_to_pass_values_from_a_view_to_a_controller\" title=\"8. Can hidden fields be used to pass values from a view to a controller?\">8. Can hidden fields be used to pass values from a view to a controller?<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-10\" href=\"https:\/\/namso-gen.co\/blog\/how-to-pass-value-from-view-to-controller-in-mvc\/#9_What_role_do_routing_attributes_play_in_passing_values_between_views_and_controllers\" title=\"9. What role do routing attributes play in passing values between views and controllers?\">9. What role do routing attributes play in passing values between views and controllers?<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-11\" href=\"https:\/\/namso-gen.co\/blog\/how-to-pass-value-from-view-to-controller-in-mvc\/#10_How_can_file_uploads_be_handled_when_passing_data_from_a_view_to_a_controller\" title=\"10. How can file uploads be handled when passing data from a view to a controller?\">10. How can file uploads be handled when passing data from a view to a controller?<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-12\" href=\"https:\/\/namso-gen.co\/blog\/how-to-pass-value-from-view-to-controller-in-mvc\/#11_Can_session_variables_be_used_to_pass_values_from_a_view_to_a_controller\" title=\"11. Can session variables be used to pass values from a view to a controller?\">11. Can session variables be used to pass values from a view to a controller?<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-13\" href=\"https:\/\/namso-gen.co\/blog\/how-to-pass-value-from-view-to-controller-in-mvc\/#12_Are_there_any_security_considerations_when_passing_values_from_a_view_to_a_controller\" title=\"12. Are there any security considerations when passing values from a view to a controller?\">12. Are there any security considerations when passing values from a view to a controller?<\/a><\/li><\/ul><\/nav><\/div>\n<h3><span class=\"ez-toc-section\" id=\"FAQs_on_passing_value_from_view_to_controller_in_MVC\"><\/span>FAQs on passing value from view to controller in MVC:<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<h3><span class=\"ez-toc-section\" id=\"1_Can_data_be_passed_from_a_view_to_a_controller_without_using_form_submissions\"><\/span>1. Can data be passed from a view to a controller without using form submissions?<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>\nYes, data can also be passed using query strings, route parameters, or AJAX requests in MVC frameworks.<\/p>\n<h3><span class=\"ez-toc-section\" id=\"2_What_is_model_binding_in_MVC\"><\/span>2. What is model binding in MVC?<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>\nModel binding is a process in MVC where incoming data is mapped to parameters of an action method based on naming conventions or attributes.<\/p>\n<h3><span class=\"ez-toc-section\" id=\"3_Can_view_components_communicate_directly_with_the_controller_in_MVC\"><\/span>3. Can view components communicate directly with the controller in MVC?<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>\nIn the MVC pattern, the view should not communicate directly with the controller. Instead, user input should be passed to the controller for processing.<\/p>\n<h3><span class=\"ez-toc-section\" id=\"4_How_can_dropdown_values_be_passed_from_a_view_to_a_controller\"><\/span>4. How can dropdown values be passed from a view to a controller?<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>\nDropdown values can be included in a form submission as selected options or passed as query parameters in the URL.<\/p>\n<h3><span class=\"ez-toc-section\" id=\"5_Is_it_possible_to_pass_complex_objects_from_a_view_to_a_controller\"><\/span>5. Is it possible to pass complex objects from a view to a controller?<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>\nYes, complex objects can be serialized into JSON and sent to a controller action via AJAX requests in MVC.<\/p>\n<h3><span class=\"ez-toc-section\" id=\"6_What_are_TempData_and_ViewBag_in_ASPNET_MVC\"><\/span>6. What are TempData and ViewBag in ASP.NET MVC?<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>\nTempData and ViewBag are mechanisms for passing data between the controller and view in ASP.NET MVC. TempData persists data for the next request, while ViewBag passes data from the controller to the view.<\/p>\n<h3><span class=\"ez-toc-section\" id=\"7_How_can_multiple_values_be_passed_from_a_view_to_a_controller\"><\/span>7. How can multiple values be passed from a view to a controller?<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>\nMultiple values can be passed using arrays, lists, or dictionaries in the form fields of the view, which can be mapped to corresponding parameters in the controller action.<\/p>\n<h3><span class=\"ez-toc-section\" id=\"8_Can_hidden_fields_be_used_to_pass_values_from_a_view_to_a_controller\"><\/span>8. Can hidden fields be used to pass values from a view to a controller?<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>\nYes, hidden fields can store values in the view that can be submitted along with the form data to the controller.<\/p>\n<h3><span class=\"ez-toc-section\" id=\"9_What_role_do_routing_attributes_play_in_passing_values_between_views_and_controllers\"><\/span>9. What role do routing attributes play in passing values between views and controllers?<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>\nRouting attributes can be used to define custom routes that map URLs to specific controller actions, allowing for more flexibility in passing values between views and controllers.<\/p>\n<h3><span class=\"ez-toc-section\" id=\"10_How_can_file_uploads_be_handled_when_passing_data_from_a_view_to_a_controller\"><\/span>10. How can file uploads be handled when passing data from a view to a controller?<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>\nFile uploads can be included in a form submission using the `<input type=\"file\">` element, and the controller action can access the uploaded file through the HttpRequest object.<\/p>\n<h3><span class=\"ez-toc-section\" id=\"11_Can_session_variables_be_used_to_pass_values_from_a_view_to_a_controller\"><\/span>11. Can session variables be used to pass values from a view to a controller?<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>\nSession variables can be used to store and retrieve data across multiple requests, allowing values to be passed between views and controllers in ASP.NET MVC.<\/p>\n<h3><span class=\"ez-toc-section\" id=\"12_Are_there_any_security_considerations_when_passing_values_from_a_view_to_a_controller\"><\/span>12. Are there any security considerations when passing values from a view to a controller?<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p>\nYes, it&#8217;s important to validate and sanitize user input to prevent security vulnerabilities like SQL injection or cross-site scripting attacks when passing values from a view to a controller in MVC applications.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>In the Model-View-Controller (MVC) architecture, the view represents the user interface, the controller processes user input, and the model manages the application&#8217;s data and business logic. One common task in MVC development is passing data from the view to the controller. This allows user input or selected values in the view to be sent back &#8230; <\/p>\n<p class=\"read-more-container\"><a title=\"How to pass value from view to controller in MVC?\" class=\"read-more button\" href=\"https:\/\/namso-gen.co\/blog\/how-to-pass-value-from-view-to-controller-in-mvc\/#more-235586\">Read more<span class=\"screen-reader-text\">How to pass value from view to controller in MVC?<\/span><\/a><\/p>\n","protected":false},"author":59,"featured_media":107420,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[86279],"tags":[],"class_list":["post-235586","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-learn","no-featured-image-padding"],"yoast_head":"<!-- This site is optimized with the Yoast SEO plugin v22.1 - https:\/\/yoast.com\/wordpress\/plugins\/seo\/ -->\n<title>How to pass value from view to controller in MVC?<\/title>\n<meta name=\"description\" content=\"In the Model-View-Controller (MVC) architecture, the view represents the user interface, the controller processes user input, and the model manages the\" \/>\n<meta name=\"robots\" content=\"index, follow, max-snippet:-1, max-image-preview:large, max-video-preview:-1\" \/>\n<link rel=\"canonical\" href=\"https:\/\/namso-gen.co\/blog\/how-to-pass-value-from-view-to-controller-in-mvc\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"How to pass value from view to controller in MVC?\" \/>\n<meta property=\"og:description\" content=\"In the Model-View-Controller (MVC) architecture, the view represents the user interface, the controller processes user input, and the model manages the\" \/>\n<meta property=\"og:url\" content=\"https:\/\/namso-gen.co\/blog\/how-to-pass-value-from-view-to-controller-in-mvc\/\" \/>\n<meta property=\"og:site_name\" content=\"Namso Gen Blog - Free Credit Card Generator [100% Valid]\" \/>\n<meta property=\"article:publisher\" content=\"https:\/\/www.facebook.com\/synchronyfinancial\" \/>\n<meta property=\"article:published_time\" content=\"2024-06-20T07:38:59+00:00\" \/>\n<meta property=\"og:image\" content=\"https:\/\/namso-gen.co\/blog\/wp-content\/uploads\/2024\/03\/faq.png\" \/>\n\t<meta property=\"og:image:width\" content=\"1200\" \/>\n\t<meta property=\"og:image:height\" content=\"630\" \/>\n\t<meta property=\"og:image:type\" content=\"image\/png\" \/>\n<meta name=\"author\" content=\"Francis French\" \/>\n<meta name=\"twitter:card\" content=\"summary_large_image\" \/>\n<meta name=\"twitter:creator\" content=\"@synchrony\" \/>\n<meta name=\"twitter:site\" content=\"@synchrony\" \/>\n<meta name=\"twitter:label1\" content=\"Written by\" \/>\n\t<meta name=\"twitter:data1\" content=\"Francis French\" \/>\n\t<meta name=\"twitter:label2\" content=\"Est. reading time\" \/>\n\t<meta name=\"twitter:data2\" content=\"3 minutes\" \/>\n<script type=\"application\/ld+json\" class=\"yoast-schema-graph\">{\"@context\":\"https:\/\/schema.org\",\"@graph\":[{\"@type\":\"Article\",\"@id\":\"https:\/\/namso-gen.co\/blog\/how-to-pass-value-from-view-to-controller-in-mvc\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/namso-gen.co\/blog\/how-to-pass-value-from-view-to-controller-in-mvc\/\"},\"author\":{\"name\":\"Francis French\",\"@id\":\"https:\/\/namso-gen.co\/blog\/#\/schema\/person\/1622769be52c41a10d83bee2c48a8c48\"},\"headline\":\"How to pass value from view to controller in MVC?\",\"datePublished\":\"2024-06-20T07:38:59+00:00\",\"dateModified\":\"2024-06-20T07:38:59+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/namso-gen.co\/blog\/how-to-pass-value-from-view-to-controller-in-mvc\/\"},\"wordCount\":706,\"commentCount\":0,\"publisher\":{\"@id\":\"https:\/\/namso-gen.co\/blog\/#organization\"},\"articleSection\":[\"Learn\"],\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"CommentAction\",\"name\":\"Comment\",\"target\":[\"https:\/\/namso-gen.co\/blog\/how-to-pass-value-from-view-to-controller-in-mvc\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/namso-gen.co\/blog\/how-to-pass-value-from-view-to-controller-in-mvc\/\",\"url\":\"https:\/\/namso-gen.co\/blog\/how-to-pass-value-from-view-to-controller-in-mvc\/\",\"name\":\"How to pass value from view to controller in MVC?\",\"isPartOf\":{\"@id\":\"https:\/\/namso-gen.co\/blog\/#website\"},\"datePublished\":\"2024-06-20T07:38:59+00:00\",\"dateModified\":\"2024-06-20T07:38:59+00:00\",\"description\":\"In the Model-View-Controller (MVC) architecture, the view represents the user interface, the controller processes user input, and the model manages the\",\"breadcrumb\":{\"@id\":\"https:\/\/namso-gen.co\/blog\/how-to-pass-value-from-view-to-controller-in-mvc\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/namso-gen.co\/blog\/how-to-pass-value-from-view-to-controller-in-mvc\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/namso-gen.co\/blog\/how-to-pass-value-from-view-to-controller-in-mvc\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/namso-gen.co\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"How to pass value from view to controller in MVC?\"}]},{\"@type\":\"WebSite\",\"@id\":\"https:\/\/namso-gen.co\/blog\/#website\",\"url\":\"https:\/\/namso-gen.co\/blog\/\",\"name\":\"Namso Gen Blog - Free Credit Card Generator [100% Valid]\",\"description\":\"In Namso gen blog you can get many tips regarding to Credit cards, VCC, Credit card security etc. You can generate credit cards by using Namso-gen.co\",\"publisher\":{\"@id\":\"https:\/\/namso-gen.co\/blog\/#organization\"},\"potentialAction\":[{\"@type\":\"SearchAction\",\"target\":{\"@type\":\"EntryPoint\",\"urlTemplate\":\"https:\/\/namso-gen.co\/blog\/?s={search_term_string}\"},\"query-input\":\"required name=search_term_string\"}],\"inLanguage\":\"en-US\"},{\"@type\":\"Organization\",\"@id\":\"https:\/\/namso-gen.co\/blog\/#organization\",\"name\":\"Namso Gen Blog - Free Credit Card Generator [100% Valid]\",\"url\":\"https:\/\/namso-gen.co\/blog\/\",\"logo\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/namso-gen.co\/blog\/#\/schema\/logo\/image\/\",\"url\":\"https:\/\/namso-gen.co\/blog\/wp-content\/uploads\/2020\/07\/namso-gen-logo.png\",\"contentUrl\":\"https:\/\/namso-gen.co\/blog\/wp-content\/uploads\/2020\/07\/namso-gen-logo.png\",\"width\":500,\"height\":164,\"caption\":\"Namso Gen Blog - Free Credit Card Generator [100% Valid]\"},\"image\":{\"@id\":\"https:\/\/namso-gen.co\/blog\/#\/schema\/logo\/image\/\"},\"sameAs\":[\"https:\/\/www.facebook.com\/synchronyfinancial\",\"https:\/\/twitter.com\/synchrony\",\"https:\/\/www.youtube.com\/synchronyfinancial\",\"https:\/\/www.instagram.com\/synchrony\",\"https:\/\/www.linkedin.com\/company\/synchrony-financial\"]},{\"@type\":\"Person\",\"@id\":\"https:\/\/namso-gen.co\/blog\/#\/schema\/person\/1622769be52c41a10d83bee2c48a8c48\",\"name\":\"Francis French\",\"image\":{\"@type\":\"ImageObject\",\"inLanguage\":\"en-US\",\"@id\":\"https:\/\/namso-gen.co\/blog\/#\/schema\/person\/image\/\",\"url\":\"https:\/\/secure.gravatar.com\/avatar\/?s=96&d=mm&r=g\",\"contentUrl\":\"https:\/\/secure.gravatar.com\/avatar\/?s=96&d=mm&r=g\",\"caption\":\"Francis French\"},\"description\":\"Guest author Francis French has meticulously crafted and revised this article to the best of their knowledge and understanding. Readers are strongly advised to exercise caution, verify information independently, and rely on their own judgment when considering the information provided. Read more articles on Namso Gen here.\"}]}<\/script>\n<!-- \/ Yoast SEO plugin. -->","yoast_head_json":{"title":"How to pass value from view to controller in MVC?","description":"In the Model-View-Controller (MVC) architecture, the view represents the user interface, the controller processes user input, and the model manages the","robots":{"index":"index","follow":"follow","max-snippet":"max-snippet:-1","max-image-preview":"max-image-preview:large","max-video-preview":"max-video-preview:-1"},"canonical":"https:\/\/namso-gen.co\/blog\/how-to-pass-value-from-view-to-controller-in-mvc\/","og_locale":"en_US","og_type":"article","og_title":"How to pass value from view to controller in MVC?","og_description":"In the Model-View-Controller (MVC) architecture, the view represents the user interface, the controller processes user input, and the model manages the","og_url":"https:\/\/namso-gen.co\/blog\/how-to-pass-value-from-view-to-controller-in-mvc\/","og_site_name":"Namso Gen Blog - Free Credit Card Generator [100% Valid]","article_publisher":"https:\/\/www.facebook.com\/synchronyfinancial","article_published_time":"2024-06-20T07:38:59+00:00","og_image":[{"width":1200,"height":630,"url":"https:\/\/namso-gen.co\/blog\/wp-content\/uploads\/2024\/03\/faq.png","type":"image\/png"}],"author":"Francis French","twitter_card":"summary_large_image","twitter_creator":"@synchrony","twitter_site":"@synchrony","twitter_misc":{"Written by":"Francis French","Est. reading time":"3 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/namso-gen.co\/blog\/how-to-pass-value-from-view-to-controller-in-mvc\/#article","isPartOf":{"@id":"https:\/\/namso-gen.co\/blog\/how-to-pass-value-from-view-to-controller-in-mvc\/"},"author":{"name":"Francis French","@id":"https:\/\/namso-gen.co\/blog\/#\/schema\/person\/1622769be52c41a10d83bee2c48a8c48"},"headline":"How to pass value from view to controller in MVC?","datePublished":"2024-06-20T07:38:59+00:00","dateModified":"2024-06-20T07:38:59+00:00","mainEntityOfPage":{"@id":"https:\/\/namso-gen.co\/blog\/how-to-pass-value-from-view-to-controller-in-mvc\/"},"wordCount":706,"commentCount":0,"publisher":{"@id":"https:\/\/namso-gen.co\/blog\/#organization"},"articleSection":["Learn"],"inLanguage":"en-US","potentialAction":[{"@type":"CommentAction","name":"Comment","target":["https:\/\/namso-gen.co\/blog\/how-to-pass-value-from-view-to-controller-in-mvc\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/namso-gen.co\/blog\/how-to-pass-value-from-view-to-controller-in-mvc\/","url":"https:\/\/namso-gen.co\/blog\/how-to-pass-value-from-view-to-controller-in-mvc\/","name":"How to pass value from view to controller in MVC?","isPartOf":{"@id":"https:\/\/namso-gen.co\/blog\/#website"},"datePublished":"2024-06-20T07:38:59+00:00","dateModified":"2024-06-20T07:38:59+00:00","description":"In the Model-View-Controller (MVC) architecture, the view represents the user interface, the controller processes user input, and the model manages the","breadcrumb":{"@id":"https:\/\/namso-gen.co\/blog\/how-to-pass-value-from-view-to-controller-in-mvc\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/namso-gen.co\/blog\/how-to-pass-value-from-view-to-controller-in-mvc\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/namso-gen.co\/blog\/how-to-pass-value-from-view-to-controller-in-mvc\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/namso-gen.co\/blog\/"},{"@type":"ListItem","position":2,"name":"How to pass value from view to controller in MVC?"}]},{"@type":"WebSite","@id":"https:\/\/namso-gen.co\/blog\/#website","url":"https:\/\/namso-gen.co\/blog\/","name":"Namso Gen Blog - Free Credit Card Generator [100% Valid]","description":"In Namso gen blog you can get many tips regarding to Credit cards, VCC, Credit card security etc. You can generate credit cards by using Namso-gen.co","publisher":{"@id":"https:\/\/namso-gen.co\/blog\/#organization"},"potentialAction":[{"@type":"SearchAction","target":{"@type":"EntryPoint","urlTemplate":"https:\/\/namso-gen.co\/blog\/?s={search_term_string}"},"query-input":"required name=search_term_string"}],"inLanguage":"en-US"},{"@type":"Organization","@id":"https:\/\/namso-gen.co\/blog\/#organization","name":"Namso Gen Blog - Free Credit Card Generator [100% Valid]","url":"https:\/\/namso-gen.co\/blog\/","logo":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/namso-gen.co\/blog\/#\/schema\/logo\/image\/","url":"https:\/\/namso-gen.co\/blog\/wp-content\/uploads\/2020\/07\/namso-gen-logo.png","contentUrl":"https:\/\/namso-gen.co\/blog\/wp-content\/uploads\/2020\/07\/namso-gen-logo.png","width":500,"height":164,"caption":"Namso Gen Blog - Free Credit Card Generator [100% Valid]"},"image":{"@id":"https:\/\/namso-gen.co\/blog\/#\/schema\/logo\/image\/"},"sameAs":["https:\/\/www.facebook.com\/synchronyfinancial","https:\/\/twitter.com\/synchrony","https:\/\/www.youtube.com\/synchronyfinancial","https:\/\/www.instagram.com\/synchrony","https:\/\/www.linkedin.com\/company\/synchrony-financial"]},{"@type":"Person","@id":"https:\/\/namso-gen.co\/blog\/#\/schema\/person\/1622769be52c41a10d83bee2c48a8c48","name":"Francis French","image":{"@type":"ImageObject","inLanguage":"en-US","@id":"https:\/\/namso-gen.co\/blog\/#\/schema\/person\/image\/","url":"https:\/\/secure.gravatar.com\/avatar\/?s=96&d=mm&r=g","contentUrl":"https:\/\/secure.gravatar.com\/avatar\/?s=96&d=mm&r=g","caption":"Francis French"},"description":"Guest author Francis French has meticulously crafted and revised this article to the best of their knowledge and understanding. Readers are strongly advised to exercise caution, verify information independently, and rely on their own judgment when considering the information provided. Read more articles on Namso Gen here."}]}},"_links":{"self":[{"href":"https:\/\/namso-gen.co\/blog\/wp-json\/wp\/v2\/posts\/235586","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/namso-gen.co\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/namso-gen.co\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/namso-gen.co\/blog\/wp-json\/wp\/v2\/users\/59"}],"replies":[{"embeddable":true,"href":"https:\/\/namso-gen.co\/blog\/wp-json\/wp\/v2\/comments?post=235586"}],"version-history":[{"count":0,"href":"https:\/\/namso-gen.co\/blog\/wp-json\/wp\/v2\/posts\/235586\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/namso-gen.co\/blog\/wp-json\/wp\/v2\/media\/107420"}],"wp:attachment":[{"href":"https:\/\/namso-gen.co\/blog\/wp-json\/wp\/v2\/media?parent=235586"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/namso-gen.co\/blog\/wp-json\/wp\/v2\/categories?post=235586"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/namso-gen.co\/blog\/wp-json\/wp\/v2\/tags?post=235586"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}