Hello,
I am fairly new to custom development in DNN and was wondering if someone could help me out...
Basically, I have a database table and a stored procedure and i want to execute the stored procedure on page load and populate a dropdownlist.
I have it working i think but the strange thing is that the html for the dropdownlist doesn't look well formed when i do a "view source". Every item I have programatically added is missing the "</option>" tag...
The html code for the dropdownlist is as follows:
<asp:DropDownList ID="DropDownListBorough" runat="server">
</asp:DropDownList>
And the code i am using to populate the dropdownlist is as follows:
Dim sqlDataProvider As SqlDataProvider = CType(DataProvider.Instance(), SqlDataProvider)
Dim connectStr As String = sqlDataProvider.ConnectionString
Dim dbo As String = sqlDataProvider.DatabaseOwner
Dim oq As String = sqlDataProvider.ObjectQualifier
Dim PortalID As Integer = Me.PortalId
Dim dr As IDataReader = CType(SqlHelper.ExecuteReader(connectStr, dbo & oq & "TaxiRoute_GetAuthorityNames"), IDataReader)
Do While dr.Read()
DropDownListBorough.Items.Add(New ListItem(dr("Authority_Name"), dr("AuthorityID")))
Loop
dr.Close()
Can anyone give me some help?
Thanks
Trev