"Get Updates : Subscribe to our e-mail newsletter to receive updates........" "Good Luck frnds" Admission 2018 Application Form 2018 Colleges Entrance Exam 2018 Results 2018 Notification 2018 University Educational Jobs 2018 Government Jobs 2018

Search This Blog v24s guys

Follow by Email

03 April, 2013

jQuery Get QueryString Value | Get QueryString Parameter Values in jQuery


Here I will explain how to get query string parameter values using jQuery or get query string variable values using jQuery in asp.net

In previous articles I explained 
jQuery get current page url and title, jQuery change textbox background color on focus, jQuery Enable or disable textbox controls, jQuery create rounded corners for textbox, and many articles relating to JavaScript, jQuery, asp.net. Now I will explain how to get query string parameter values using jQuery in asp.net.

To implement this we need to write the code like as shown below

<html xmlns="http://www.w3.org/1999/xhtml">
<title>jQuery Get Current Page Url Parameter values</title>
<script type="text/javascript" src="http://code.jquery.com/jquery-1.8.2.js"></script>
<script type="text/javascript">
$(function () {
var name = GetParameterValues('username');
var id = GetParameterValues('userid');
$('#spn_UserName').html('<strong>' + name + '</strong>');
$('#spn_UserId').html('<strong>' + id + '</strong>');
function GetParameterValues(param) {
var url = window.location.href.slice(window.location.href.indexOf('?') + 1).split('&');
for (var i = 0; i < url.length; i++) {
var urlparam = url[i].split('=');
if (urlparam[0] == param) {
return urlparam[1];
<form id="form1" runat="server">
<p>UserName: <span id="spn_UserName"></span></p>
<p>UserId: <span id="spn_UserId"></span></p>

To check above example I given ur like “http://aspdotnet-suresh.com/test.aspx?username=suresh&userid=2” and it return values like as shown below 

Post a Comment

Popular Posts

Recent Posts

Google Analytics