Solved

binding  combobox cannot save value into the table

Posted on 2008-10-23
2
348 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

Microsoft Certification Exam 74-409

Veeam® is happy to provide the Microsoft community with a study guide prepared by MVP and MCT, Orin Thomas. This guide will take you through each of the exam objectives, helping you to prepare for and pass the examination.

Question has a verified solution.

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

Problem Hi all,    While many today have fast Internet connection, there are many still who do not, or are connecting through devices with a slower connect, so light web pages and fast load times are still popular.    If your ASP.NET page …
International Data Corporation (IDC) prognosticates that before the current the year gets over disbursing on IT framework products to be sent in cloud environs will be $37.1B.
This Micro Tutorial will teach you how to censor certain areas of your screen. The example in this video will show a little boy's face being blurred. This will be demonstrated using Adobe Premiere Pro CS6.
Microsoft Active Directory, the widely used IT infrastructure, is known for its high risk of credential theft. The best way to test your Active Directory’s vulnerabilities to pass-the-ticket, pass-the-hash, privilege escalation, and malware attacks …

772 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