I'm trying to get the value of one of the fields in a sqldatasource that fills a dropdown list within a Formview with ASP.NET 2.0 using Visual Studio (vb).
I want to be able to get the value of one of the fields in the datasource that is not the Datatextfield or the Datavalue field. (I need to populate a textbox control with this other value.)
I know how to get the datatextfield and datavaluefield values by doing the following:
Dim ddlCompanyName as DropDownList
Dim txtCompanyName as Textbox
ddlCompanyName = CType(formview1.Row.FindControl("ddlCompanyName"), DropdownList)
txtCompanyName = CType(formview1.row.FindControl("CompanyNameTextbox"),Textbox)
txtCompanyName.text = ddlCompanyName.Items(ddlCompanyName.SelectedIndex).Text
But I need to be able to get at another member field of the datasource to populate a different field
Can anyone give me some suggestions?
Thanks!
I want to be able to get the value of one of the fields in the datasource that is not the Datatextfield or the Datavalue field. (I need to populate a textbox control with this other value.)
I know how to get the datatextfield and datavaluefield values by doing the following:
Dim ddlCompanyName as DropDownList
Dim txtCompanyName as Textbox
ddlCompanyName = CType(formview1.Row.FindControl("ddlCompanyName"), DropdownList)
txtCompanyName = CType(formview1.row.FindControl("CompanyNameTextbox"),Textbox)
txtCompanyName.text = ddlCompanyName.Items(ddlCompanyName.SelectedIndex).Text
But I need to be able to get at another member field of the datasource to populate a different field
Can anyone give me some suggestions?
Thanks!