I have a JavaScript function into which I put some text thus
@{
var price = @HttpUtility.UrlDecode(Request.QueryString["MaxBudget"]);
<script type="text/javascript">
PopulateFormInput('SearchMaxBudget', '@price', 'modal-search-budget-box');
</script>
}
Now, MaxBudget is ‘£100-£199’ but for some reason when I execute this piece of code I get this in the text box.

I’ve checked in the debugger and the value passed to PopulateFormInput is ‘£100-£199’ and passing this value in another place statically (i.e. passing the hard coded text ‘£100-£199’) works fine. Why is this failing?
Thanks,
Sachin
Here’s the solution, for anyone who is interested