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
Loading
krithika muthukrishnanPosted Jan 6, 2011, 4:09 AM
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..
ShankeyPosted Jan 6, 2011, 2:20 AM
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;
}
}
}
Subhendu DePosted Jan 6, 2011, 1:46 AM
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().