I had to check about data retrieve from data base in DDL and if this data equal specific value user will redirect to specific site (URL) .I tried to make this with if statement but it did not work please anyone help me.
protected void IMGSite_Click(object sender, ImageClickEventArgs e)
{
if (DDLBrand.SelectedItem.Text="Sharp")
{
Response.Redirect("http://toshiba.elarabygroup.com/");
}
if (DDLBrand.SelectedItem.Text = "Seiko")
{
Response.Redirect("http://Seiko.elarabygroup.com/");
}
}
DDLBrand.SelectedItem.Text = "Seiko"should be
DDLBrand.SelectedItem.Text == "Seiko"Use two equal signs! Same for other comparison (== “Sharp”)
Edit:
To open in a new window try: