[Solved] Set TextBox as required based upon “selected” value of DropDownList

[ad_1]

Add following code in SelectedIndexChanged event in .cs file

 protected void PositionShift_SelectedIndexChanged(object sender, EventArgs e)
        {
            if (PositionShift.SelectedIndex == 1 || PositionShift.SelectedIndex == 3 || PositionShift.SelectedIndex == 5)
            {
                RequisitionNumberLabel.Text = "*";
            }
            else
            {
                RequisitionNumberLabel.Text = "Requisition Number";
            }
        }

Also, set Autopostback property of DropDownList to True.

[ad_2]

solved Set TextBox as required based upon “selected” value of DropDownList