How to get Query string value, how to get values from url query with validation and best practice.
public int ItemID
{
get
{
if (Request.QueryString["ID"] != null && Request.QueryString["ID"].Length > 0)
{
return Convert.ToInt32(Request.QueryString["ID"]);
}
else return 0;
}
}
Thanks,
Praveen Pandit
MCTS; MCPD
Keep Sharing Knowledge!!
public int ItemID
{
get
{
if (Request.QueryString["ID"] != null && Request.QueryString["ID"].Length > 0)
{
return Convert.ToInt32(Request.QueryString["ID"]);
}
else return 0;
}
}
Thanks,
Praveen Pandit
MCTS; MCPD
Keep Sharing Knowledge!!
No comments:
Post a Comment