using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using
Utilities;
namespace UserControls
{
public partial class CustomUserControlExample2 :
System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
if (!IsPostBack)
{
PopulateList();
}
}
protected void ddlProducts_SelectedIndexChanged(object sender, EventArgs e)
{
pdProduct.ProductID
= ddlProducts.SelectedValue;
pdProduct.ProductImage
= "images/" + pdProduct.ProductID + ".jpg";
pdProduct.DataBind();
pdProduct.Visible
= true;
}
public void PopulateList()
{
DBConnect objDB = new DBConnect();
String strSQL = "SELECT * FROM Product ORDER BY Description";
ddlProducts.DataSource
= objDB.GetDataSet(strSQL);
ddlProducts.DataTextField
= "Description";
ddlProducts.DataValueField
= "ProductNumber";
ddlProducts.DataBind();
}
}
}