{"id":16352116,"url":"https://github.com/bugthesystem/aspnet.mvc.configurationexporter","last_synced_at":"2026-04-29T20:08:58.524Z","repository":{"id":26149949,"uuid":"29595116","full_name":"bugthesystem/AspNet.Mvc.ConfigurationExporter","owner":"bugthesystem","description":"Makes server side configurations are available on client side","archived":false,"fork":false,"pushed_at":"2017-09-24T21:52:19.000Z","size":921,"stargazers_count":3,"open_issues_count":1,"forks_count":1,"subscribers_count":3,"default_branch":"master","last_synced_at":"2026-03-25T03:19:45.494Z","etag":null,"topics":["c-sharp","configuration","javascript"],"latest_commit_sha":null,"homepage":"","language":"C#","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/bugthesystem.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-01-21T15:07:14.000Z","updated_at":"2021-07-01T22:34:10.000Z","dependencies_parsed_at":"2022-08-01T06:08:33.545Z","dependency_job_id":null,"html_url":"https://github.com/bugthesystem/AspNet.Mvc.ConfigurationExporter","commit_stats":null,"previous_names":["bugthesystem/aspnet.mvc.configurationexporter","ziyasal/aspnet.mvc.configurationexporter"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/bugthesystem/AspNet.Mvc.ConfigurationExporter","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bugthesystem%2FAspNet.Mvc.ConfigurationExporter","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bugthesystem%2FAspNet.Mvc.ConfigurationExporter/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bugthesystem%2FAspNet.Mvc.ConfigurationExporter/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bugthesystem%2FAspNet.Mvc.ConfigurationExporter/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/bugthesystem","download_url":"https://codeload.github.com/bugthesystem/AspNet.Mvc.ConfigurationExporter/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/bugthesystem%2FAspNet.Mvc.ConfigurationExporter/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":32441615,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-04-29T18:12:22.909Z","status":"ssl_error","status_checked_at":"2026-04-29T18:11:33.322Z","response_time":110,"last_error":"SSL_connect returned=1 errno=0 peeraddr=140.82.121.5:443 state=error: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["c-sharp","configuration","javascript"],"created_at":"2024-10-11T01:25:01.174Z","updated_at":"2026-04-29T20:08:58.492Z","avatar_url":"https://github.com/bugthesystem.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"# AspNet.Mvc.ConfigurationExporter\nProvides server side configurations to available on client side\n\n[![Build status](https://ci.appveyor.com/api/projects/status/34tj2t4lf30ck7gt?svg=true)](https://ci.appveyor.com/project/ziyasal/aspnet-mvc-configurationexporter)\n\nHOW TO USE\n---------------------------\n\nTo install AspNet.Mvc.ConfigurationExporter;\n```\n Install-Package AspNet.Mvc.ConfigurationExporter\n```\n\nRegister configuration exporter route;\n```csharp\n RouteTable.Routes.MapConfigExporter();\n ```\n\nSet configuration export mode;  \n **Mode: SECTION**  \n  ```xml\n  \u003cadd key=\"configr:Mode\" value=\"Section\" /\u003e\n ```\n Add configuration section to web.config;\n ```xml\n \u003csection name=\"exportConfigr\" type=\"AspNet.Mvc.ConfigurationExporter.Section.ConfigrSectionHandler,\n AspNet.Mvc.ConfigurationExporter, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null\" /\u003e\n ```\n\n  Add configuration section values to web.config;\n  ```xml\n   \u003cexportConfigr\u003e\n    \u003cappSettings\u003e\n      \u003cadd key=\"AKey\" value=\"true\" /\u003e\n      \u003cadd key=\"BKey\" value=\"false\" /\u003e\n      \u003cadd key=\"CKey\" value=\"12\" /\u003e\n      \u003cadd key=\"DKey\" value=\"Github\" /\u003e\n      \u003cadd key=\"EKey\" value=\"Look ma!\" /\u003e\n    \u003c/appSettings\u003e\n  \u003c/exportConfigr\u003e\n  ```\n**Mode: KEYS**  \n\nAdd following settings to appSettings;\n```xml\n\u003cadd key=\"AKey\" value=\"true\" /\u003e\n\u003cadd key=\"BKey\" value=\"false\" /\u003e\n\u003cadd key=\"CKey\" value=\"12\" /\u003e\n\u003cadd key=\"DKey\" value=\"Github\" /\u003e\n\u003cadd key=\"configr:Keys\" value=\"AKey|BKey|CKey|DKey\" /\u003e\n \u003cadd key=\"configr:Mode\" value=\"Keys\" /\u003e\n```\n\n### Export property values from custom types\n\n**Suppose that we have a type and we'd like to make its properties available on client side which marked with `ConfigrExportable`**\n```csharp\n\npublic interface ITestConfiguration\n  {\n      int TestInt { get; }\n      string TestString { get; }\n      int TestProperty { get; }\n  }\n\n  public class TestConfiguration : ITestConfiguration\n  {\n      public int TestInt { get { return 20; } }\n\n      [ConfigrExportable]\n      public string TestString { get { return \"https://github.com/PanteonProject\"; } }\n\n      [ConfigrExportable(Name = \"testName\")]\n      public int TestProperty { get { return 10; } }\n\n  }\n```\nRegister type to exporter;  \n\n```csharp\n\nExporter.Instance.RegisterType\u003cITestConfiguration\u003e(type =\u003e \n                    DependencyResolver.Current.GetService(type));\n//OR\nExporter.Instance.RegisterType\u003cITestConfiguration\u003e(type =\u003e \n                    (ITestConfiguration)new TestConfiguration());\n```\n\n\nAdd following script tag to your page;\n```html\n\u003cscript type=\"text/javascript\" src=\"~/configr\"\u003e\u003c/script\u003e\n```\n\nAccess from js;\n```js\nconsole.log(window.configuration.AKey);\n```\n**Custom JS Namespace**  \n\n Alternatively you can declare a namespace in App.config like this.\n   ```xml\n  \u003cadd key=\"configr:Namespace\" value=\"github.config\" /\u003e\n ```\n and access from js :\n ```js\nconsole.log(github.config.AKey);\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbugthesystem%2Faspnet.mvc.configurationexporter","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fbugthesystem%2Faspnet.mvc.configurationexporter","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fbugthesystem%2Faspnet.mvc.configurationexporter/lists"}