Under home folder there is an index.html file where we are rendering static and dynamic content from DB.
in the homecontroller.cs we have the below code
[Route("")]
[Route(utmquerystring)]
public IActionResult Index([FromQuery]string utm)
{
// dynamic code to pull the data from DB and return to the view
return View(viewModel);
}
In the startup.cs file we have the below code in Configure method.
app.UseMvc(routes =>
{
routes.MapRoute(
name: "default",
template: "{controller=Home}/{action=Index}/{id?}");
});
when we run the code the initial URL shows http://localhost:40404
And then pass the additional parameter like http://localhost:40404/?utm=test but once the page loaded completed its stripping out the ?utm=test from the URL but we need to retain the query string even after load the page completely.
Please let me know if you need any other details.