{"id":21450595,"url":"https://github.com/ogaudefroy/routelocalization.webforms","last_synced_at":"2025-03-17T02:24:38.420Z","repository":{"id":80337878,"uuid":"67302336","full_name":"ogaudefroy/RouteLocalization.WebForms","owner":"ogaudefroy","description":"ASP.Net localized routing for WebForms routes","archived":false,"fork":false,"pushed_at":"2016-11-09T09:31:45.000Z","size":24,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-01-23T12:15:42.967Z","etag":null,"topics":["asp-net","routing","seo","webforms","webforms-routes"],"latest_commit_sha":null,"homepage":null,"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/ogaudefroy.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,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2016-09-03T17:16:33.000Z","updated_at":"2017-11-25T18:28:53.000Z","dependencies_parsed_at":"2023-03-02T02:31:05.135Z","dependency_job_id":null,"html_url":"https://github.com/ogaudefroy/RouteLocalization.WebForms","commit_stats":null,"previous_names":[],"tags_count":3,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ogaudefroy%2FRouteLocalization.WebForms","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ogaudefroy%2FRouteLocalization.WebForms/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ogaudefroy%2FRouteLocalization.WebForms/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/ogaudefroy%2FRouteLocalization.WebForms/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/ogaudefroy","download_url":"https://codeload.github.com/ogaudefroy/RouteLocalization.WebForms/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243960637,"owners_count":20375108,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["asp-net","routing","seo","webforms","webforms-routes"],"created_at":"2024-11-23T04:15:54.319Z","updated_at":"2025-03-17T02:24:38.398Z","avatar_url":"https://github.com/ogaudefroy.png","language":"C#","funding_links":[],"categories":[],"sub_categories":[],"readme":"# RouteLocalization.WebForms\r\nASP.Net localized routing for WebForms routes\r\n\r\n[![Build status](https://ci.appveyor.com/api/projects/status/tnob0qx1b8wdmwxj?svg=true)](https://ci.appveyor.com/project/ogaudefroy/routelocalization-webforms) [![NuGet version](https://badge.fury.io/nu/RouteLocalization.WebForms.svg)](https://badge.fury.io/nu/RouteLocalization.WebForms)\r\n\r\n## Declare a localized route\r\nJust add a configured LocalizationRouteCollection in your route tables.\r\nThis component acts as a wrapper containing all localized routes (neutral included) and maps to a [PageRouteHandler](https://msdn.microsoft.com/en-us/library/system.web.routing.pageroutehandler(v=vs.110).aspx).\r\n```C#\r\nvar routes = new LocalizationRouteCollection(\r\n                virtualPath: \"~/pages/offer/details.aspx\",\r\n                defaults: null,\r\n                constraints: new RouteValueDictionary() { { \"id\", @\"\\d+\" } }, });\r\nroute.AddTranslation(LocalizationRouteCollection.NeutralRoute, \"neutral/neutral-{title}_{id}\");\r\nroute.AddTranslation(\"en-US\", \"job/job-{title}_{id}\");\r\nroute.AddTranslation(\"fr-FR\", \"offre-de-emploi/offre-{title}_{id}\");\r\nRouteTable.Routes.Add(\"OfferDetails\", route);\r\n```\r\n\r\n## Retrieving route culture\r\n\r\nRoute culture can be easily retrieved as the culture is added in route values dictionary\r\n\r\n```C#\r\nprotected override void InitializeCulture() {\r\n    var routeCulture = this.RouteData.Values[\"culture\"] as string;\r\n    if (routeCulture != null) {\r\n        this.Culture = new CultureInfo(routeCulture);\r\n        this.UICulture = new CultureInfo(routeCulture);\r\n    }\r\n}\r\n```\r\n## Outbound routing\r\n```C#\r\n// Classical way\r\nRouteTable.Routes.GetVirtualPath(null, \"OfferDetails\", new RouteValueDictionary() {{\"title\", \"chef-de-projet\"}, {\"id\", 12}}).VirtualPath\r\n\r\n// With explicit culture\r\nRouteTable.Routes.GetVirtualPath(null, \"OfferDetails\", new RouteValueDictionary() {{\"title\", \"chef-de-projet\"}, {\"id\", 12}, {\"id\", \"fr-FR\"}).VirtualPath\r\n\r\n// Through RouteUrlExpressionBuilder\r\n\u003casp:HyperLink runat=\"server\" NavigateUrl=\"\u003c%$RouteUrl:title=chef-de-projet,id=12,routename=OfferDetails%\u003e\" Text=\"Details\" /\u003e \r\n```\r\n\r\nInspired by [RouteLocalization](https://github.com/Dresel/RouteLocalization)\r\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fogaudefroy%2Froutelocalization.webforms","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fogaudefroy%2Froutelocalization.webforms","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fogaudefroy%2Froutelocalization.webforms/lists"}