1

Warning: The question refers to the RC version of ASP.net MVC.
Problem is solved in ASP.net MVC 1.0

I have a page that requests some JSON from an Action on my controller and then fills a table with that data. In my JSON reponse, I'm including an anon object that contains some fields. One of those fields is a URL to another controller/action. I am setting the URL using Url.Action in my controller.

The problem is that the link that comes out is not valid (due to context I guess). For instance, the "hosting" page URL looks like this:

/Challenges/Detail/4/HEADLINE which is {controller}/{action}/{id}/{slug}

The URL in my json request calls the Profile action on my Account Controller. The URL should be something like this:

/Profile/username

However, it comes out as

../Profile/username 

which resolves to

/Challenges/Detail/4/Profile/username

I'd like to avoid hardcoding any links if at all possible. What are my options here?

1 Answer 1

2

Craig Stuntz answered this yesterday but his answer disappeared. He was correct, that I needed to install the ASP.NET MVC RC Refresh

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.