Gopal Biswas Gopal Biswas - 1 year ago 64
ASP.NET (C#) Question

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

I have a menu in page like below:

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

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.

Answer Source

Like this:

<a href="" onclick="location.href='employerlist.aspx?id=' + getQueryStringValue('id');return false;">Add Employer</a>
Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download