Re: How do I get the value of a DropDownList control that was defined by customizing the CreateUserWizard control?



Only fill the listbox on the first GET -

in Page_Load - enclose the databinding code in

If not IsPostback
....

---------------------------------------
Dominick Baier - DevelopMentor
http://www.leastprivilege.com

Hello,

We have a need to customize the CreateUserWizard and we put a
DropDownList control in there. And we are filling that DropDownControl
( drplDealers) in the page load event of the code behind page on
which

the CreatUserWizard control is existing.

This my Page load event thats filling the drop down and this works
fine

I am getting the data.

**********************************************************************
***** ­****************************

Protected Sub Page Load(ByVal sender As Object, ByVal e As
System.EventArgs) Handles Me.Load
drplDealerShipID =
CType(CreateUserWizard1.CreateUserStep.ContentTemplateContainer.FindCo
ntrol
­(" drplDealers"),

DropDownList)
Dim GetDealers As SqlDataReader = GetGroundingBL.GetDealers()
drplDealerShipID.DataSource = GetDealers
drplDealerShipID.DataValueField = "DealerShipID"
drplDealerShipID.DataTextField = "DealerShipName"
drplDealerShipID.DataBind()
GetDealers.Close()
End Sub
**********************************************************************
*****
­*****************************

But in the CreateUserWizard1 CreatedUser event I can't get the
selected

value of the drplDealers

**********************************************************************
***** ­****************************

Protected Sub CreateUserWizard1 CreatedUser(ByVal sender As Object,
ByVal e As System.EventArgs) Handles CreateUserWizard1.CreatedUser Dim
drplDealerShipID As DropDownList =

CType(CreateUserWizard1.CreateUserStep.ContentTemplateContainer.FindCo
ntrol ­(" drplDealers"),

DropDownList)
Dim dealer As String
dealer = drplDealerShipID.SelectedValue.ToString
dealer = drplDealerShipID.SelectedValue.ToString
End Sub
**********************************************************************
***** ­*****************************

I am not sure the way I am trying to acces the dropdown control that
was filled before in the page load event is right but it doesnt' throw
any error but I always get nothing although if I have selected a
value.

Am I missing some thing here?

Thanks -L




.



Relevant Pages