I am sending some values from one page to another in asp.net using javascript. I have declared JS in parent page and the values are being sent to child page and fetched in code behind page using Request.Querystring. Look to my previous question here
To give you a detailed look, See below example
chStatusReport.Attributes.Add("onclick", "javascript:return Navigate( '" + varTrimmed+ "' );");
JS to open a child page is under
<script type="text/javascript" language="javascript">
function Navigate(status) {
window.open("ChildPage.aspx?status=" + status)
return false;
}
</script>
Code fetching the value pass from parent to child page.
if (Request.QueryString.Count!=0)
{ svar1= Request.QueryString["status"];
}
Values that are being passed are like 1 )Tom & Peter 2 ) Laurence & Hardy
The values that i get are 1 ) Tom 2) Laurence
Why the remaining text get trimmed?
You can’t use & directly in querystring.
You have to either encode or change & to another unicode manually and translate it back.
Here is a link for explanation.
http://www.kamath.com/codelibrary/cl006_url.asp