MVC3 Url.Action querystring generation?

Up vote 14 down vote favorite 3 share g+ share fb share tw.

I am trying to generate an url for an MVC 3 action within javascript environment (in a cshtml file). Now this works almost fine, my problem is that the querystring is being escaped. Instead of: "/Products/GetProductImage?

ProductId=1&pos=0&size=0" it generates: "/Products/GetProductImage? ProductId=1&pos=0&size=0" so my action does not get called. Now I know I can make my own custom Url helper function, but I was wondering if I can use this or some other built in helper to get the unescaped URL?

Thanks in advance, G. Asp.net mvc asp. Net-mvc-3 razor link|improve this question asked May 3 '11 at 15:49egyedg237310 83% accept rate.

1 of course, how did I not think of that... thanks so much – egyedg May 3 '11 at 16:05 1 Thanks! I had the same problem :) Though it should be @HtmlRaw(Url. Action(/*...*/)) rather than @HtmlRaw(HtmlUrl.

Action(/*...*/)) – lethek Aug 12 '11 at 5:55.

Var src = "@Html. Raw(Url. Action("GetProductImage", new { productId = Model.Product.

Id, pos = 1, size = 0 }))"; Url. Action worked for me not HtmlUrl. Action Enjoy!

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions