How Can I (Or Is It Possible?) Add Item to Html Combobox ServerSide ?
Or Bind It in behind Code in asp.net ?
Does My question Clear?
How Can I (Or Is It Possible?) Add Item to Html Combobox ServerSide ?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
Do you want to modify a HTML
selecttag in code behind?If yes, here is what you need to do:
runat=serverin your tag(
<select id="s1" runat="server">)a datasource (a datatable for
example), set the datasource
s1.DataSource = dtset the propertys1.DataTextFieldto the property ofthe datasource you want to bind as
the text shown to the user, the
s1.ValueTextFieldto the property ofthe datasource to use as the value,
and call the
s1.Databind()methodcan call
s1.Items.Add/AddRange/Insert/Remove/RemoveAtmethod.