Im using asp.net mvc. c#
How can i get the existing url (may have a bunch of querystring parameters on it) and then just append another parameter to the quesrystring. and make this a clickable hyperlink.
You're going to need to build a custom RouteValueDictionary
variable to pass to Html.ActionLink. Try something like this:
<%
var rvd = new RouteValueDictionary(ViewContext.RouteData.Values);
foreach (string key in Request.QueryString.Keys )
{
rvd[key]=Request.QueryString[key];
}
rvd["MyParam"] = "WhateverValue";
Response.Write(Html.ActionLink("Link Text", "Action", rvd));
%>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With