Intersoft Support Center

Set Value At Runtime

In many case, we usually want to set a default text in the first or initial load of WebCombo based on its DataValueField.

In this topic, you will learn how to set WebCombo's value at runtime.

To set value at runtime

  1. Bind WebCombo to AccessDataSource control. (Use Customers table)
  2. To set the Webcombo value control you need to define Value property on Page_Load event.
    C# Copy ImageCopy Code
    protected void Page_Load(object sender, EventArgs e)
    {
       WebCombo1.Value = "ANATR";
    }

  3. In this case, the combo text is based on one of the value ANATR, which is Ana Trujillo.
  4. Run the project.
Previous Next