EG :
url : http://www.sareeshmg.blogspot.com?id=2"
<script language="javascript" type="text/javascript">
function getQueryParams(qs) {
qs = qs.split("+").join(" ");
var params = {};
var tokens,
re = /[?&]?([^=]+)=([^&]*)/g;
while (tokens = re.exec(qs)) {
params[decodeURIComponent(tokens[1])]
= decodeURIComponent(tokens[2]);
}
return params;
}
var $_GET = getQueryParams(document.location.search);
//To Capture query string value at aspx page use like this
var TestID = $_GET['id'];
</script>
---------------------
ON Code behind aspx.cs page
to capture query string ID
int TestID = Convert.ToInt32(Request.QueryString["id"].ToString());
url : http://www.sareeshmg.blogspot.com?id=2"
<script language="javascript" type="text/javascript">
function getQueryParams(qs) {
qs = qs.split("+").join(" ");
var params = {};
var tokens,
re = /[?&]?([^=]+)=([^&]*)/g;
while (tokens = re.exec(qs)) {
params[decodeURIComponent(tokens[1])]
= decodeURIComponent(tokens[2]);
}
return params;
}
var $_GET = getQueryParams(document.location.search);
//To Capture query string value at aspx page use like this
var TestID = $_GET['id'];
</script>
---------------------
ON Code behind aspx.cs page
to capture query string ID
int TestID = Convert.ToInt32(Request.QueryString["id"].ToString());
No comments:
Post a Comment