Thank you Raterus, I do have that check in place.
here is the code:
public class Reseller : CheckoutModule
{
protected System.Web.UI.WebControls.DropDownList drpReseller;
protected ServicesController servicesCtrl = new ServicesController();
protected System.Web.UI.WebControls.CheckBoxList licenseKeyList;
private void Page_Load(object sender, System.EventArgs e)
{
if(!Page.IsPostBack)
{
if(Request.Params["ProductID"] != null)
{
ViewState["PRODUCT_ID"] = Request.Params["ProductID"];
BindLicenseKeyResellers();
BindResellers();
}
}
}
private void BindLicenseKeyResellers()
{
licenseKeyList.DataSource =
servicesCtrl.GetLicenseKeyResellersByProductID(Convert.ToInt32(ViewState["PR
ODUCT_ID"]));
licenseKeyList.DataBind();
}
private void BindResellers()
{
drpReseller.DataSource =
servicesCtrl.GetLicenseKeyResellersByProductID(Convert.ToInt32(ViewState["PR
ODUCT_ID"]));
drpReseller.DataBind();
}
public override void SaveVarsToSession()
{
Session["RESELLER_KEY"] = drpReseller.SelectedIndex;
}
Sounds like you have something like this...
Sub page_load
BindDropDownList()
End Sub
It needs to be this
Sub page_load
if not page.ispostback()
BindDropDownList()
end if
end sub
Roger R. Smith said:
Hi all, I am sure you have seen this issue. I have an aspx page which loads
a UserControl at runtime.
In this user control I have a dropdownlist which is populated dynamically.
If I click a submit button and try to put the selectedvalue from the
dropdown into the session, it will always put the first selected item into
the session, not the actual item I selected.
Does anyone have any advice for this?