2

I would like passing a ViewModel parameter into url.

This parameter is an object inherit of

Dictionary<int, string>.

Into RC1, I can customize the url building with an override of "ToString" method :

public override string ToString()
{
    return String.Join("#", this.Select(d => d.Key + "|" + d.Value));
}

So the url have a value like this :

myUrl?parameter=1|one#2|two

But since the last update into ASP NET Core 1.0, this not working, and no find other solution into the web.

Have you an idea ?

Thanks.

2
  • Why you want this? What you want to achieve from this ? Commented Jul 27, 2016 at 12:14
  • I just need passing my ViewModel with all values, include this Dictionnary. And for that I used "RedirectToAction("Index", viewModel)". MVC auto convert parameters for the url Commented Jul 27, 2016 at 12:18

1 Answer 1

1

I asked to developers, and there is a workaround for this : https://github.com/aspnet/Mvc/issues/5093

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

1 Comment

While this link may answer the question, it is better to include the essential parts of the answer here and provide the link for reference. Link-only answers can become invalid if the linked page changes

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.