Dismiss
Announcing Stack Overflow Documentation

We started with Q&A. Technical documentation is next, and we need your help.

Whether you're a beginner or an experienced developer, you can contribute.

Sign up and start helping → Learn more about Documentation →

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.

share|improve this question
    
Why you want this? What you want to achieve from this ? – Sunil Kumar Jul 27 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 – Damien Leroy Jul 27 at 12:18
up vote 0 down vote accepted

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

share|improve this answer
    
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 – MegaTron Aug 1 at 22:36

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.