Код: Выделить всё
this.Response.Redirect(string.Format("frmProducts.aspx?d={0}&i={1}", this.ddlDepartments.SelectedValue, this.ProductId.ToString()), true);
< /code>
Я попытался установить проверку, но она не сработала, как ниже: < /p>
if (this.ddlDepartments.SelectedValue!=null && this.ProductId.ToString() != null)
this.Response.Redirect(string.Format("frmProducts.aspx?d={0}&i={1}", this.ddlDepartments.SelectedValue, this.ProductId.ToString()), true);
Подробнее здесь: https://stackoverflow.com/questions/671 ... in-asp-net