There's nothing in the Android URI class that gives you the base URL directly- As gnuf suggests, you'd have to construct it as the protocol + getHost(). The string parsing way might be easier and let you avoid stuffing everything in a try/catch block.
How to Get the Base URL in an MVC Controller. Here's a simple one-liner to get the job done. var baseUrl = string. Format(“{0}://{1}{2}”, Request.
I want to send an email to the user where he can click on link to transfer to my site. I don't want to hard code the url in my Email Templates. I want this dynamic in a sense that whatever the environment it will send the related url. Like If I am on the development environment it send something like http://localhost:port
or in production send the actual website url. http://www.domain.com
I just need to know how can I save it in DynamicViewBag
in MVC Action. Any suggestion plz?
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