Exemplo n.º 1
0
 protected void Page_Load(object sender, EventArgs e)
 {
     if ("useKey" != null)
     {
         if (!IsPostBack)
         {
             DataTable table = uw.GetPeople();
             PersonDropDownList.DataSource     = table;
             PersonDropDownList.DataTextField  = "PersonName";
             PersonDropDownList.DataValueField = "PersonKey";
             PersonDropDownList.DataBind();
             ListItem item = new ListItem("Select a Person");
             PersonDropDownList.Items.Insert(0, item);
         }
     }
     else
     {
         Response.Redirect("Default.aspx");
     }
 }