my coding is
if (Request.QueryString["uid"].ToString() != "0")
{
string dummy =Request.QueryString["uid"].ToString();
Label1.Text = dummy;
Response.Redirect("../Profile/Home1.aspx?uid="+ dummy );
}
else
{
Label1.Text = "none";
Session["AccountId"] = 0;
}
my problem is am using in this coding in home page.. if it is the first page in website querystring creates problem.. if the user starts with login page means it works. now i want to avoid the querystring problem.
you have to fix your if condition to check for
null– otherwise you will get an Exception when trying to callToString()onnull:But there is a better way to do this –
QueryStringalready returns a string: