By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
443,640 Members | 1,363 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 443,640 IT Pros & Developers. It's quick & easy.

Dropdownlist not working

P: n/a
Hi All,

This is what I am trying to do.I have an aspx page with the the following
code block.

<asp:DropDownList id="DropDownList1" runat="server" DataSource="<%#
GetUsers%>" DataTextField="user_email" DataValueField="user_id">
</asp:DropDownList>

GetUsers is defined in the .vb file

Public Function GetUsers() As DataSet

Dim ds As DataSet
ds =
SqlHelper.ExecuteDataset(ConfigurationSettings.App Settings("ConnectionString
"), CommandType.Text, "select user_id , user_email from users")
Return ds

End Function
I am kind of frustrated that I cannot make this thing work.What am I doing
wrong ?

--binod

Nov 20 '05 #1
Share this Question
Share on Google+
2 Replies


P: n/a

in your code behind... after you get Users

call

DropDownList1.DataBind()

Peace,
"Binod Nair" <na*******@hotmail.com> wrote in message
news:Of*************@tk2msftngp13.phx.gbl...
Hi All,

This is what I am trying to do.I have an aspx page with the the following
code block.

<asp:DropDownList id="DropDownList1" runat="server" DataSource="<%#
GetUsers%>" DataTextField="user_email" DataValueField="user_id">
</asp:DropDownList>

GetUsers is defined in the .vb file

Public Function GetUsers() As DataSet

Dim ds As DataSet
ds =
SqlHelper.ExecuteDataset(ConfigurationSettings.App Settings("ConnectionString "), CommandType.Text, "select user_id , user_email from users")
Return ds

End Function
I am kind of frustrated that I cannot make this thing work.What am I doing
wrong ?

--binod

Nov 20 '05 #2

P: n/a
Wait.. not in yoru get users. but in your load is probably where you'll be
safest.

so on your load procedure.

if not (page.isPostBack) then
me.DropDownList1.DataBind()
end if
"Binod Nair" <na*******@hotmail.com> wrote in message
news:Of*************@tk2msftngp13.phx.gbl...
Hi All,

This is what I am trying to do.I have an aspx page with the the following
code block.

<asp:DropDownList id="DropDownList1" runat="server" DataSource="<%#
GetUsers%>" DataTextField="user_email" DataValueField="user_id">
</asp:DropDownList>

GetUsers is defined in the .vb file

Public Function GetUsers() As DataSet

Dim ds As DataSet
ds =
SqlHelper.ExecuteDataset(ConfigurationSettings.App Settings("ConnectionString "), CommandType.Text, "select user_id , user_email from users")
Return ds

End Function
I am kind of frustrated that I cannot make this thing work.What am I doing
wrong ?

--binod

Nov 20 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.