{"id":235379,"date":"2024-06-19T15:26:47","date_gmt":"2024-06-19T15:26:47","guid":{"rendered":"https:\/\/namso-gen.co\/blog\/?p=235379"},"modified":"2024-06-19T15:26:47","modified_gmt":"2024-06-19T15:26:47","slug":"how-to-get-appsettings-json-value-in-cshtml","status":"publish","type":"post","link":"https:\/\/namso-gen.co\/blog\/how-to-get-appsettings-json-value-in-cshtml\/","title":{"rendered":"How to get appsettings JSON value in cshtml?"},"content":{"rendered":"<p>Many developers often face the question of how to retrieve values from the appsettings.json file in a cshtml file. This can be crucial when you need to access configuration settings within your Razor views. Luckily, there is a straightforward way to accomplish this in ASP.NET Core.<\/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-2'><a class=\"ez-toc-link ez-toc-heading-1\" href=\"https:\/\/namso-gen.co\/blog\/how-to-get-appsettings-json-value-in-cshtml\/#Step-by-Step_Guide\" title=\"Step-by-Step Guide\">Step-by-Step Guide<\/a><ul class='ez-toc-list-level-3' ><li class='ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-2\" href=\"https:\/\/namso-gen.co\/blog\/how-to-get-appsettings-json-value-in-cshtml\/#Step_1_Inject_Configuration_Service\" title=\"Step 1: Inject Configuration Service\">Step 1: Inject Configuration Service<\/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-get-appsettings-json-value-in-cshtml\/#Step_2_Retrieve_Value\" title=\"Step 2: Retrieve Value\">Step 2: Retrieve Value<\/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-get-appsettings-json-value-in-cshtml\/#Example\" title=\"Example\">Example<\/a><\/li><\/ul><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-5\" href=\"https:\/\/namso-gen.co\/blog\/how-to-get-appsettings-json-value-in-cshtml\/#Frequently_Asked_Questions\" title=\"Frequently Asked Questions\">Frequently Asked Questions<\/a><ul class='ez-toc-list-level-3' ><li class='ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-6\" href=\"https:\/\/namso-gen.co\/blog\/how-to-get-appsettings-json-value-in-cshtml\/#How_do_I_access_multiple_values_from_the_appsettingsjson_file_in_cshtml\" title=\"How do I access multiple values from the appsettings.json file in cshtml?\">How do I access multiple values from the appsettings.json file in cshtml?<\/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-get-appsettings-json-value-in-cshtml\/#Can_I_use_the_Configuration_object_in_all_cshtml_files_within_my_ASPNET_Core_project\" title=\"Can I use the Configuration object in all cshtml files within my ASP.NET Core project?\">Can I use the Configuration object in all cshtml files within my ASP.NET Core project?<\/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-get-appsettings-json-value-in-cshtml\/#Is_it_possible_to_change_appsettingsjson_values_dynamically_and_reflect_these_changes_in_cshtml_files_without_restarting_the_application\" title=\"Is it possible to change appsettings.json values dynamically and reflect these changes in cshtml files without restarting the application?\">Is it possible to change appsettings.json values dynamically and reflect these changes in cshtml files without restarting the application?<\/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-get-appsettings-json-value-in-cshtml\/#Can_I_access_nested_values_from_the_appsettingsjson_file_in_cshtml\" title=\"Can I access nested values from the appsettings.json file in cshtml?\">Can I access nested values from the appsettings.json file in cshtml?<\/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-get-appsettings-json-value-in-cshtml\/#Is_it_secure_to_access_sensitive_information_from_the_appsettingsjson_file_in_cshtml\" title=\"Is it secure to access sensitive information from the appsettings.json file in cshtml?\">Is it secure to access sensitive information from the appsettings.json file in cshtml?<\/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-get-appsettings-json-value-in-cshtml\/#Can_I_access_appsettingsjson_values_in_a_layout_cshtml_file\" title=\"Can I access appsettings.json values in a layout cshtml file?\">Can I access appsettings.json values in a layout cshtml file?<\/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-get-appsettings-json-value-in-cshtml\/#What_happens_if_a_key_is_missing_from_the_appsettingsjson_file\" title=\"What happens if a key is missing from the appsettings.json file?\">What happens if a key is missing from the appsettings.json file?<\/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-get-appsettings-json-value-in-cshtml\/#Is_there_a_way_to_reload_appsettingsjson_values_in_cshtml_without_restarting_the_application\" title=\"Is there a way to reload appsettings.json values in cshtml without restarting the application?\">Is there a way to reload appsettings.json values in cshtml without restarting the application?<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-14\" href=\"https:\/\/namso-gen.co\/blog\/how-to-get-appsettings-json-value-in-cshtml\/#Can_I_access_appsettingsjson_values_in_JavaScript_within_cshtml_files\" title=\"Can I access appsettings.json values in JavaScript within cshtml files?\">Can I access appsettings.json values in JavaScript within cshtml files?<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-15\" href=\"https:\/\/namso-gen.co\/blog\/how-to-get-appsettings-json-value-in-cshtml\/#Can_I_access_values_from_different_environments_development_staging_production_in_cshtml_files\" title=\"Can I access values from different environments (development, staging, production) in cshtml files?\">Can I access values from different environments (development, staging, production) in cshtml files?<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-16\" href=\"https:\/\/namso-gen.co\/blog\/how-to-get-appsettings-json-value-in-cshtml\/#Is_it_possible_to_access_appsettingsjson_values_in_partial_views_in_cshtml_files\" title=\"Is it possible to access appsettings.json values in partial views in cshtml files?\">Is it possible to access appsettings.json values in partial views in cshtml files?<\/a><\/li><li class='ez-toc-page-1 ez-toc-heading-level-3'><a class=\"ez-toc-link ez-toc-heading-17\" href=\"https:\/\/namso-gen.co\/blog\/how-to-get-appsettings-json-value-in-cshtml\/#Can_I_access_values_from_custom_configuration_files_other_than_appsettingsjson_in_cshtml\" title=\"Can I access values from custom configuration files other than appsettings.json in cshtml?\">Can I access values from custom configuration files other than appsettings.json in cshtml?<\/a><\/li><\/ul><\/li><li class='ez-toc-page-1 ez-toc-heading-level-2'><a class=\"ez-toc-link ez-toc-heading-18\" href=\"https:\/\/namso-gen.co\/blog\/how-to-get-appsettings-json-value-in-cshtml\/#Conclusion\" title=\"Conclusion\">Conclusion<\/a><\/li><\/ul><\/nav><\/div>\n<h2><span class=\"ez-toc-section\" id=\"Step-by-Step_Guide\"><\/span>Step-by-Step Guide<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>To access values from the appsettings.json file in your cshtml file, follow these steps:<\/p>\n<ol><\/p>\n<li>Inject the configuration service into your view.<\/li>\n<p><\/p>\n<li>Retrieve the value using the Configuration object.<\/li>\n<p>\n<\/ol>\n<p>Now let&#8217;s delve deeper into each step to understand how it can be done.<\/p>\n<h3><span class=\"ez-toc-section\" id=\"Step_1_Inject_Configuration_Service\"><\/span>Step 1: Inject Configuration Service<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p><\/p>\n<p>First, in your cshtml file, inject the configuration service by adding the following code at the top of the file:<\/p>\n<p>&#8220;`csharp<br \/>\n@inject Microsoft.Extensions.Configuration.IConfiguration Configuration<br \/>\n&#8220;`<\/p>\n<p>This line of code allows you to access the Configuration object, which provides access to your appsettings.json values.<\/p>\n<h3><span class=\"ez-toc-section\" id=\"Step_2_Retrieve_Value\"><\/span>Step 2: Retrieve Value<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p><\/p>\n<p>After injecting the Configuration service, you can now retrieve the values from your appsettings.json file. For example, if you have a key called &#8220;MySetting&#8221; in your appsettings.json file, you can access its value as shown below:<\/p>\n<p>&#8220;`csharp<br \/>\n@Configuration[&#8220;MySetting&#8221;]<br \/>\n&#8220;`<\/p>\n<h3><span class=\"ez-toc-section\" id=\"Example\"><\/span>Example<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p><\/p>\n<p>Here is an example where we retrieve a value from the appsettings.json file and display it in the cshtml file:<\/p>\n<p>&#8220;`csharp<\/p>\n<p>&#8220;`<\/p>\n<p>By following these simple steps, you can easily access values from your appsettings.json file in your cshtml files.<\/p>\n<h2><span class=\"ez-toc-section\" id=\"Frequently_Asked_Questions\"><\/span>Frequently Asked Questions<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<h3><span class=\"ez-toc-section\" id=\"How_do_I_access_multiple_values_from_the_appsettingsjson_file_in_cshtml\"><\/span>How do I access multiple values from the appsettings.json file in cshtml?<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p><\/p>\n<p>You can access multiple values by using multiple Configuration objects with different keys in your cshtml file.<\/p>\n<h3><span class=\"ez-toc-section\" id=\"Can_I_use_the_Configuration_object_in_all_cshtml_files_within_my_ASPNET_Core_project\"><\/span>Can I use the Configuration object in all cshtml files within my ASP.NET Core project?<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p><\/p>\n<p>Yes, once you inject the Configuration service in one cshtml file, you can access it in all other cshtml files.<\/p>\n<h3><span class=\"ez-toc-section\" id=\"Is_it_possible_to_change_appsettingsjson_values_dynamically_and_reflect_these_changes_in_cshtml_files_without_restarting_the_application\"><\/span>Is it possible to change appsettings.json values dynamically and reflect these changes in cshtml files without restarting the application?<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p><\/p>\n<p>No, the values in the appsettings.json file are read when the application starts. If you need to change values dynamically, consider using a different approach like a database or environment variables.<\/p>\n<h3><span class=\"ez-toc-section\" id=\"Can_I_access_nested_values_from_the_appsettingsjson_file_in_cshtml\"><\/span>Can I access nested values from the appsettings.json file in cshtml?<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p><\/p>\n<p>Yes, you can access nested values by specifying the full path to the value. For example, if you have a nested object called &#8220;Nested&#8221; with a key &#8220;Value&#8221;, you can access it using @Configuration[&#8220;Nested:Value&#8221;].<\/p>\n<h3><span class=\"ez-toc-section\" id=\"Is_it_secure_to_access_sensitive_information_from_the_appsettingsjson_file_in_cshtml\"><\/span>Is it secure to access sensitive information from the appsettings.json file in cshtml?<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p><\/p>\n<p>It is not recommended to store sensitive information in the appsettings.json file. Instead, consider using a secure configuration provider or a secure vault to store sensitive data.<\/p>\n<h3><span class=\"ez-toc-section\" id=\"Can_I_access_appsettingsjson_values_in_a_layout_cshtml_file\"><\/span>Can I access appsettings.json values in a layout cshtml file?<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p><\/p>\n<p>Yes, you can inject the Configuration service in your layout cshtml file and access the values throughout your views.<\/p>\n<h3><span class=\"ez-toc-section\" id=\"What_happens_if_a_key_is_missing_from_the_appsettingsjson_file\"><\/span>What happens if a key is missing from the appsettings.json file?<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p><\/p>\n<p>If a key is missing, accessing it in your cshtml file will return a null value. Make sure to handle null values appropriately in your code.<\/p>\n<h3><span class=\"ez-toc-section\" id=\"Is_there_a_way_to_reload_appsettingsjson_values_in_cshtml_without_restarting_the_application\"><\/span>Is there a way to reload appsettings.json values in cshtml without restarting the application?<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p><\/p>\n<p>Unfortunately, there is no built-in mechanism to reload values from the appsettings.json file without restarting the application in ASP.NET Core.<\/p>\n<h3><span class=\"ez-toc-section\" id=\"Can_I_access_appsettingsjson_values_in_JavaScript_within_cshtml_files\"><\/span>Can I access appsettings.json values in JavaScript within cshtml files?<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p><\/p>\n<p>Yes, you can render values from the appsettings.json file into your cshtml file and then access them in JavaScript code.<\/p>\n<h3><span class=\"ez-toc-section\" id=\"Can_I_access_values_from_different_environments_development_staging_production_in_cshtml_files\"><\/span>Can I access values from different environments (development, staging, production) in cshtml files?<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p><\/p>\n<p>Yes, you can specify different appsettings.json files for different environments and access the values based on the environment your application is running in.<\/p>\n<h3><span class=\"ez-toc-section\" id=\"Is_it_possible_to_access_appsettingsjson_values_in_partial_views_in_cshtml_files\"><\/span>Is it possible to access appsettings.json values in partial views in cshtml files?<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p><\/p>\n<p>Yes, you can inject the Configuration service in your partial views and access the values just like in regular cshtml files.<\/p>\n<h3><span class=\"ez-toc-section\" id=\"Can_I_access_values_from_custom_configuration_files_other_than_appsettingsjson_in_cshtml\"><\/span>Can I access values from custom configuration files other than appsettings.json in cshtml?<span class=\"ez-toc-section-end\"><\/span><\/h3>\n<p><\/p>\n<p>Yes, you can specify custom configuration providers in ASP.NET Core and access values from those files in your cshtml files.<\/p>\n<h2><span class=\"ez-toc-section\" id=\"Conclusion\"><\/span>Conclusion<span class=\"ez-toc-section-end\"><\/span><\/h2>\n<p>Retrieving values from the appsettings.json file in cshtml files is a common task for ASP.NET Core developers. By following the steps outlined in this guide, you can easily access configuration settings within your Razor views and customize your application based on these values. Remember to handle sensitive information securely and consider alternative approaches for dynamic configuration changes.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Many developers often face the question of how to retrieve values from the appsettings.json file in a cshtml file. This can be crucial when you need to access configuration settings within your Razor views. Luckily, there is a straightforward way to accomplish this in ASP.NET Core. Step-by-Step Guide To access values from the appsettings.json file &#8230; <\/p>\n<p class=\"read-more-container\"><a title=\"How to get appsettings JSON value in cshtml?\" class=\"read-more button\" href=\"https:\/\/namso-gen.co\/blog\/how-to-get-appsettings-json-value-in-cshtml\/#more-235379\">Read more<span class=\"screen-reader-text\">How to get appsettings JSON value in cshtml?<\/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-235379","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 get appsettings JSON value in cshtml?<\/title>\n<meta name=\"description\" content=\"Many developers often face the question of how to retrieve values from the appsettings.json file in a cshtml file. This can be crucial when you need to\" \/>\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-get-appsettings-json-value-in-cshtml\/\" \/>\n<meta property=\"og:locale\" content=\"en_US\" \/>\n<meta property=\"og:type\" content=\"article\" \/>\n<meta property=\"og:title\" content=\"How to get appsettings JSON value in cshtml?\" \/>\n<meta property=\"og:description\" content=\"Many developers often face the question of how to retrieve values from the appsettings.json file in a cshtml file. This can be crucial when you need to\" \/>\n<meta property=\"og:url\" content=\"https:\/\/namso-gen.co\/blog\/how-to-get-appsettings-json-value-in-cshtml\/\" \/>\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-19T15:26:47+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=\"4 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-get-appsettings-json-value-in-cshtml\/#article\",\"isPartOf\":{\"@id\":\"https:\/\/namso-gen.co\/blog\/how-to-get-appsettings-json-value-in-cshtml\/\"},\"author\":{\"name\":\"Francis French\",\"@id\":\"https:\/\/namso-gen.co\/blog\/#\/schema\/person\/1622769be52c41a10d83bee2c48a8c48\"},\"headline\":\"How to get appsettings JSON value in cshtml?\",\"datePublished\":\"2024-06-19T15:26:47+00:00\",\"dateModified\":\"2024-06-19T15:26:47+00:00\",\"mainEntityOfPage\":{\"@id\":\"https:\/\/namso-gen.co\/blog\/how-to-get-appsettings-json-value-in-cshtml\/\"},\"wordCount\":752,\"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-get-appsettings-json-value-in-cshtml\/#respond\"]}]},{\"@type\":\"WebPage\",\"@id\":\"https:\/\/namso-gen.co\/blog\/how-to-get-appsettings-json-value-in-cshtml\/\",\"url\":\"https:\/\/namso-gen.co\/blog\/how-to-get-appsettings-json-value-in-cshtml\/\",\"name\":\"How to get appsettings JSON value in cshtml?\",\"isPartOf\":{\"@id\":\"https:\/\/namso-gen.co\/blog\/#website\"},\"datePublished\":\"2024-06-19T15:26:47+00:00\",\"dateModified\":\"2024-06-19T15:26:47+00:00\",\"description\":\"Many developers often face the question of how to retrieve values from the appsettings.json file in a cshtml file. This can be crucial when you need to\",\"breadcrumb\":{\"@id\":\"https:\/\/namso-gen.co\/blog\/how-to-get-appsettings-json-value-in-cshtml\/#breadcrumb\"},\"inLanguage\":\"en-US\",\"potentialAction\":[{\"@type\":\"ReadAction\",\"target\":[\"https:\/\/namso-gen.co\/blog\/how-to-get-appsettings-json-value-in-cshtml\/\"]}]},{\"@type\":\"BreadcrumbList\",\"@id\":\"https:\/\/namso-gen.co\/blog\/how-to-get-appsettings-json-value-in-cshtml\/#breadcrumb\",\"itemListElement\":[{\"@type\":\"ListItem\",\"position\":1,\"name\":\"Home\",\"item\":\"https:\/\/namso-gen.co\/blog\/\"},{\"@type\":\"ListItem\",\"position\":2,\"name\":\"How to get appsettings JSON value in cshtml?\"}]},{\"@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 get appsettings JSON value in cshtml?","description":"Many developers often face the question of how to retrieve values from the appsettings.json file in a cshtml file. This can be crucial when you need to","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-get-appsettings-json-value-in-cshtml\/","og_locale":"en_US","og_type":"article","og_title":"How to get appsettings JSON value in cshtml?","og_description":"Many developers often face the question of how to retrieve values from the appsettings.json file in a cshtml file. This can be crucial when you need to","og_url":"https:\/\/namso-gen.co\/blog\/how-to-get-appsettings-json-value-in-cshtml\/","og_site_name":"Namso Gen Blog - Free Credit Card Generator [100% Valid]","article_publisher":"https:\/\/www.facebook.com\/synchronyfinancial","article_published_time":"2024-06-19T15:26:47+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":"4 minutes"},"schema":{"@context":"https:\/\/schema.org","@graph":[{"@type":"Article","@id":"https:\/\/namso-gen.co\/blog\/how-to-get-appsettings-json-value-in-cshtml\/#article","isPartOf":{"@id":"https:\/\/namso-gen.co\/blog\/how-to-get-appsettings-json-value-in-cshtml\/"},"author":{"name":"Francis French","@id":"https:\/\/namso-gen.co\/blog\/#\/schema\/person\/1622769be52c41a10d83bee2c48a8c48"},"headline":"How to get appsettings JSON value in cshtml?","datePublished":"2024-06-19T15:26:47+00:00","dateModified":"2024-06-19T15:26:47+00:00","mainEntityOfPage":{"@id":"https:\/\/namso-gen.co\/blog\/how-to-get-appsettings-json-value-in-cshtml\/"},"wordCount":752,"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-get-appsettings-json-value-in-cshtml\/#respond"]}]},{"@type":"WebPage","@id":"https:\/\/namso-gen.co\/blog\/how-to-get-appsettings-json-value-in-cshtml\/","url":"https:\/\/namso-gen.co\/blog\/how-to-get-appsettings-json-value-in-cshtml\/","name":"How to get appsettings JSON value in cshtml?","isPartOf":{"@id":"https:\/\/namso-gen.co\/blog\/#website"},"datePublished":"2024-06-19T15:26:47+00:00","dateModified":"2024-06-19T15:26:47+00:00","description":"Many developers often face the question of how to retrieve values from the appsettings.json file in a cshtml file. This can be crucial when you need to","breadcrumb":{"@id":"https:\/\/namso-gen.co\/blog\/how-to-get-appsettings-json-value-in-cshtml\/#breadcrumb"},"inLanguage":"en-US","potentialAction":[{"@type":"ReadAction","target":["https:\/\/namso-gen.co\/blog\/how-to-get-appsettings-json-value-in-cshtml\/"]}]},{"@type":"BreadcrumbList","@id":"https:\/\/namso-gen.co\/blog\/how-to-get-appsettings-json-value-in-cshtml\/#breadcrumb","itemListElement":[{"@type":"ListItem","position":1,"name":"Home","item":"https:\/\/namso-gen.co\/blog\/"},{"@type":"ListItem","position":2,"name":"How to get appsettings JSON value in cshtml?"}]},{"@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\/235379","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=235379"}],"version-history":[{"count":0,"href":"https:\/\/namso-gen.co\/blog\/wp-json\/wp\/v2\/posts\/235379\/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=235379"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/namso-gen.co\/blog\/wp-json\/wp\/v2\/categories?post=235379"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/namso-gen.co\/blog\/wp-json\/wp\/v2\/tags?post=235379"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}