Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <asp:DropDownList ID="userDropDown" runat="server" DataTextField="CustomerName" DataValueField="CustomerId">
- </asp:DropDownList>
- protected void Button1_Click(object sender, EventArgs e)
- {
- if(!page.isPostBack)
- {
- userDropDown.DataSource = CC.GetCustomers();
- userDropDown.DataBind();
- }
- }
- protected void Page_Load(object sender, EventArgs e)
- {
- if (!Page.IsPostBack)
- {
- //bind your datasource here (something like below)
- userDropDown.DataSource = GetCustomers();
- userDropDown.DataBind();
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement