我有一个简单的任务,但没有简单的解决方案。
浏览器中有一个需要更改或重写的参数。
例如 www.contoso.com/countries.aspx?country=UK
我只需要重写参数而不检查URL,因此它可能会出现以下情况:
www.contoso.com/countries.aspx?country=France
我已经尝试过类似的方法,但没有成功。
string parameter2 = Request.QueryString["country"];
Context.RewritePath(parameter2.Replace("?country=", "France"));