DropDownList and TextBox?

Posted by Sbadrian under ASP.NET on 6/21/2009 | Views : 1759 | Status : [Member] | Replies : 3
I have an asp: dropdownlist a textbox and a button.

The DDL is populated from database.
What i want to do is to select a value from the DDL , and for that selected value i want to add a text when clicking the button.

For example , i select from the DDL value A, in the text box i write A10 and then i insert A10 in my database for the value A.

So how can i do that?
Any tips?

Thank you, Adrian.




Responses

Posted by: Vuyiswamb on: 6/21/2009 [Member] [MVP] [Administrator] NotApplicable

Up
0
Down
Good Morning Sbadrian

The First thing you need to do is to trap the selected value of a DDL in a selected change event and store it in a Session variable and Call call your insert Function and supply the Variable in the Function and the value of a textbox.

If you have trouble with example code, say it , i will provide.

Thank you for posting at dotnetFunda


Vuyiswa Maseko


Thank you for posting at Dotnetfunda
[Administrator]

Sbadrian, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Sbadrian on: 6/22/2009 [Member] Starter

Up
0
Down
Hello again Vuyiswa Maseko ,

The code for populating the DDL and store the change event in a session is not a problem cause i learned it from our last discussion , the problem is with the text box code how to link it with the session? yes i need some help with this one.

Thank you very much

Sbadrian, if this helps please login to Mark As Answer. | Alert Moderator

Posted by: Vuyiswamb on: 6/22/2009 [Member] [MVP] [Administrator] NotApplicable

Up
0
Down
Good Day Sbadrian

You will do the same with textbox and the textbox will be very simple


Session["MyValue"] = Textbox1.Text;



Thank you for Posting at Dotnetfunda

Vuyiswa Maseko



Thank you for posting at Dotnetfunda
[Administrator]

Sbadrian, if this helps please login to Mark As Answer. | Alert Moderator

Login to post response