Solved

binding  combobox cannot save value into the table

Posted on 2008-10-23
2
346 Views
Last Modified: 2012-05-05
         <asp:DropDownList ID="DropDownList3" runat="server"
                DataSourceID="insert_billing_categorysource" DataTextField="category_descrip"
                DataValueField="category_id" AutoPostBack="True"
                SelectedValue='<%# Bind("category") %>'
                onselectedindexchanged="DropDownList3_SelectedIndexChanged1" style="height: 22px;"
                >
            </asp:DropDownList>



why can i  save the value of catery into my table using bind what is my problem?
0
Comment
Question by:neil17317
  • 2
2 Comments
 
LVL 10

Accepted Solution

by:
jinn_hnnl earned 500 total points
ID: 22784571
What do you mean you want to save value into the table?

You mean you can not set the selected value using Bind("category")??? If so, you can try do it from your code behind where you have full control and manipulation

Let say in Page_Load:
DropDownList3.SelectedValue = Convert.ToString(DropDownList1.Items.FindByText("anyvalue").Value)  ;

JINN
0
 
LVL 10

Expert Comment

by:jinn_hnnl
ID: 22848254
In addition you can better switch around with FindByText or findByValue depend on the matching key that you want

string ddl1Selected = DropDownList1.Items.FindByText("anyvalue").Value;
DropDownList3.ClearSelection();
DropDownList3.Items.FindByValue(ddl1Selected).Selected = true;

JINN
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
crm development 2 64
How can i determine which dropdownlist caused the postback on Page Load event ? 1 40
Achieve json result 2 64
Error in JQuery 5 35
Lots of people ask this question on how to extend the “MembershipProvider” to make use of custom authentication like using existing database or make use of some other way of authentication. Many blogs show you how to extend the membership provider c…
Introduction This article shows how to use the open source plupload control to upload multiple images. The images are resized on the client side before uploading and the upload is done in chunks. Background I had to provide a way for user…
This video shows how to remove a single email address from the Outlook 2010 Auto Suggestion memory. NOTE: For Outlook 2016 and 2013 perform the exact same steps. Open a new email: Click the New email button in Outlook. Start typing the address: …
This is a video describing the growing solar energy use in Utah. This is a topic that greatly interests me and so I decided to produce a video about it.

932 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now