And now in this blog, we will discuss how to populate dropdownlist selected value from QueryString.
string qsValue;
protected void Page_Load(object sender, EventArgs e)
{
if (!Page.IsPostBack)
{
if (Request.QueryString["Name"] != null && Request.QueryString["Name"] != string.Empty)
{
//To get Query string value
qsValue = Request.QueryString["qstring"].ToString();
// Populate Dropdown list Selected Value from QueryString
ddlQstring.SelectedValue = qsValue;
}
}
}
I hope you enjoyed it.