Gopal Biswas
Gopal Biswas

Reputation: 419

How to set querystring value using javascript function in ASP.Net?

I have a menu in asp.net page like below:

<ul class="dropdown-menu">
<li>
<a href="employerlist.aspx?id=;javascript:getQueryStringValue('id');">Add Employer</a>
</li>
<li></li>
</ul>

I want to redirect pages to different urls along with a value which returned from the javascript function "getQueryStringValue". Now the problem is I cannot concatenate the url with the javascript function in "href". Any help will be appreciated.

Upvotes: 0

Views: 685

Answers (1)

cyberwombat
cyberwombat

Reputation: 40084

Like this:

<a href="" onclick="location.href='employerlist.aspx?id=' + getQueryStringValue('id');return false;">Add Employer</a>

Upvotes: 1

Related Questions