Home     |     .Net Programming    |     cSharp Home    |     Sql Server Home    |     Javascript / Client Side Development     |     Ajax Programming

Ruby on Rails Development     |     Perl Programming     |     C Programming Language     |     C++ Programming     |     IT Jobs

Python Programming Language     |     Laptop Suggestions?    |     TCL Scripting     |     Fortran Programming     |     Scheme Programming Language

Cervo Technologies
The Right Source to Outsource

MS Dynamics CRM 3.0

Asp.Net Programming

Newbie question - Use dropdownlist or textbox for db insert?

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


You can learn about  dropdownlists here:



6. Input and Selection Controls

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.

I believe you will want to use the findcontrol method


Add to del.icio.us | Digg this | Stumble it | Powered by Megasolutions Inc