How do I get the value of the DropDownList control from the CreateUserWizard?

L

Learner

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.FindControl("_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.FindControl("_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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,968
Messages
2,570,154
Members
46,702
Latest member
LukasConde

Latest Threads

Top