Skip to content

Instantly share code, notes, and snippets.

@manoj-choudhari-git
Created December 24, 2020 11:08
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save manoj-choudhari-git/34d98ede60130d276d5caab1235d637f to your computer and use it in GitHub Desktop.
Save manoj-choudhari-git/34d98ede60130d276d5caab1235d637f to your computer and use it in GitHub Desktop.
Azure CDN example: .NET Core web application and Query string
// STEP 1
// Code in HomeController.cs, Index action
// New query string parameter - version
public IActionResult Index([FromQuery]string version)
{
ViewData["version"] = version;
return View();
}
// STEP 2
// Code in _Layout.cshtml
// <a class="navbar-brand" asp-area="" asp-controller="Home" asp-action="Index">SampleApp @ViewData["version"]</a>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment