hai
in asp.net can i able to pass the query string with in the page.likewise
in first.aspx
BY Role
in first.aspx.cs
string str1
str1=Request.QueryString["str"].ToString();
//when i use like this object referene not set to an instance of an object error will eccor how can i solve this.
Thank u
About querystring in.net
3 Answers
Know the answer? Post it. Somebody with the same question will find it here.

Subhendu DeRank #1,108 · 1.7K reputationPosted Jan 5, 2011, 8:46 PM EST
in first.aspx.cs
string str1
if(Request.QueryString["str"]!=null)
str1=Request.QueryString["str"].ToString();
I would prefer to use Convert.ToString() rather than ToString().
ShankeyRank #972 · 2.1K reputationPosted Jan 5, 2011, 9:20 PM EST
You can do like as shown below which defines a getter for your str variable
private String Str
{
get
{
if (Request.QueryString["str"] != null && Convert.ToString( Request.QueryString["str"]) != String.Empty)
{
return Convert.ToString(Request.QueryString["str"]);
}
else
{
return String.Empty;
}
}
}
krithika muthukrishnanRank #8,369 · 223 reputationPosted Jan 5, 2011, 11:09 PM EST
when i pass the two querystring values one from default.aspx and then anotehr from first.aspx i retrieve these two query string values from the same first.aspx.cs page it accepts only one querystring value.it shows null for another one.
here i attached my codings..