Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

RouteUrl replace "&" with "&" in query string parameters

I have the following code:

@Url.RouteUrl("NewMessage", new { parentThreadId = Model.thread.id, cacheBustParam = currentUserId })

When the page get rendered the page source looks like:

/somepath/newMessage/12345?cacheBustParam=123&param1=value1&param2=value2

As you can see instead of plain ampesands & it places & in the query string params and that makes them unusable. How can i instruct the @Url.RouteUrl not to encode the querystring?

like image 287
PanKak Avatar asked Feb 27 '14 12:02

PanKak


1 Answers

Try using

@Html.Raw(Url.RouteUrl("NewMessage", new { parentThreadId = Model.thread.id, cacheBustParam = currentUserId }))
like image 133
Microsoft DN Avatar answered Nov 03 '22 09:11

Microsoft DN