0

have a look to the following URL: https://manage.windowsazure.com/@MYCOMPANY.onmicrosoft.com#Workspaces/CloudServicesExtension/CloudService/MYSERVICENAME/dashboard

It looks like the url is in the form {controler}/ActionName/{parameter}/ActionName

How can I generate such URL in MVC4/Razor? Indeed, I want to build url in the form: http://www.myservice.com/Configuration/{Source or Target}/{DomainName}/{ConfigurationType}

ex:

http://www.myservice.com/Configuration/Source/mydomain.com/ConnexionConfiguration http://www.myservice.com/Configuration/Source/mydomain.com/AttributesConfiguration

Thanks.

1
  • Just config your routing. There are tons of examples around it. Search routing configuration in MVC. Commented Jan 30, 2014 at 16:10

1 Answer 1

1

You can either create per action routes, for each action, or include the controller name and action name in the url and then use something like this:

routes.MapRoute("Default","{controller}/{source}/{domain}/{action}")

so a controller called Configuration with an action called Setup and a domain of example.com and source of welcome would be

/Configuration/welcome/example.com/setup

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.