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

news:1180453514.626929.27410@m36g2000hse.googlegroups.com...

You can learn about  dropdownlists here:

http://msconline.maconstate.edu/tutorials/ASPNET20/default.htm

See:

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.

-----------------------------------------------Reply-----------------------------------------------
I believe you will want to use the findcontrol method

http://msconline.maconstate.edu/tutorials/ASPNET2/ASPNET09/aspnet09-0...

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