Prasad Jadhav
Prasad Jadhav

Reputation: 5208

Reload page with different QueryString

I want to reload a page using JavaScript passing different parameters in URL.

My Page name is test1.aspx, I used:

window.location="test1.aspx?user=abc&place=xyz";

It's not working!

Upvotes: 6

Views: 21676

Answers (3)

hadi.sh
hadi.sh

Reputation: 129

window.location = "path page?user=" + $("#txtuser").val();

Upvotes: -1

Moddasir
Moddasir

Reputation: 1449

If you need to send dynamic value, then

var user = "abc";
var place = "xyz";

window.location.href = "test1.aspx?user=" + user + "&place=" + place;

Upvotes: 2

Elliot Bonneville
Elliot Bonneville

Reputation: 53301

window.location is an object. You need to access the href property on it, like this:

window.location.href="test1.aspx?user=abc&place=xyz";

Upvotes: 14

Related Questions