I have Login Controller and Register ActionResult
public ActionResult Register()
{
return View();
}
If i post any data to Register actionresult url seems like below,
WebSiteName/Login/Register
I want to change route url as WebSiteName/Login/Reg=Id?
So i tried below however i could not change route url.
routes.MapRoute(
name: "something",
url: "Login/Reg=Id?",
defaults: new
{
controller = "Login",
action = "Register",
id = id = UrlParameter.Optional
}
);
So how can i change url in asp.net mvc ?
Any help will be appreciated.
Thanks.