views:

36

answers:

2

I need to display the "www.monkey.com" part inside some view fields.

But my app runs at different addresses:

"www.monkey.com"
"www.hippo.com"
"www.giraffe.com"

How can I retrieve this name to display it in the view?

+1  A: 

You can access that data through the response and request objects, available within any controller action. You can read a bit about them here.

Mike Trpcic
+1  A: 

Specifically, request.host will do your job.

Leonid Shevtsov