I have a website I am developing (http://www.mywebsite.com/
) that makes use of subdomains. Basically what I want is when you go to: http://www.mywebsite.com/Redirect
, it redirects you to http://blahblah.mywebsite.com/SpecificController/SpecificAction
.
I know about Redirect
, but that doesn't let you send POST parameters (as far as I know), and RedirectToAction
doesn't let you specify a subdomain.
For subdomains in routes check this guide to domain routing
When you have it set up. for a specific redirection you can use this:
return RedirectToAction("SpecificAction",
"SpecificController",
new { subdomain = "blahblah");
As for the post part, you can just use the TempData dictionary (TempData["varName"]) to pass the data to the next controller/action
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With