I have a webform that i'm using to insert a new entry into a database
table. For some of the columns, I'd like to give the user the option
of using a dropdownlist or a textbox, in order to allow the user to
use an existing entry, or to create a new entry value. However, when
the user posts/submits, the form is only using the value from textbox
entry, and not the dropdownlist. I do have the dropdownlist bound to
a select distinct query for that column. Not being very familiar with
coding here, I probablyI need to put some stuff in the code behind,
but am not sure exactly what I should be doing here. I'm using
ASP.Net 2 with vb.
get the selected item of the drop down
string strGetValue = DropDownList.SelectedItem.Text or if you want the value
string strGetValue = DropDownList.SelectedItem.value
and pass strGetValue to your insert/update SQL statement
<benjamin.d
@css-security.com> wrote in message
news:1180453514.626929.27410@m36g2000hse.googlegroups.com...
>I have a webform that i'm using to insert a new entry into a database
> table. For some of the columns, I'd like to give the user the option
> of using a dropdownlist or a textbox, in order to allow the user to
> use an existing entry, or to create a new entry value. However, when
> the user posts/submits, the form is only using the value from textbox
> entry, and not the dropdownlist. I do have the dropdownlist bound to
> a select distinct query for that column. Not being very familiar with
> coding here, I probablyI need to put some stuff in the code behind,
> but am not sure exactly what I should be doing here. I'm using
> ASP.Net 2 with vb.
You can learn about dropdownlists here:
http://msconline.maconstate.edu/tutorials/ASPNET20/default.htm
See:
6. Input and Selection Controls
<benjamin.d
@css-security.com> wrote in message
news:1180453514.626929.27410@m36g2000hse.googlegroups.com...
>I have a webform that i'm using to insert a new entry into a database
> table. For some of the columns, I'd like to give the user the option
> of using a dropdownlist or a textbox, in order to allow the user to
> use an existing entry, or to create a new entry value. However, when
> the user posts/submits, the form is only using the value from textbox
> entry, and not the dropdownlist. I do have the dropdownlist bound to
> a select distinct query for that column. Not being very familiar with
> coding here, I probablyI need to put some stuff in the code behind,
> but am not sure exactly what I should be doing here. I'm using
> ASP.Net 2 with vb.
Ok, now I have a better idea of what is going on. I have the two
controls in a formview template. I need to determine how to reference
the controls inside the formview in the code behind.
-----------------------------------------------Reply-----------------------------------------------