Solved

binding  combobox cannot save value into the table

Posted on 2008-10-23
2
345 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
Comment Utility
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
Comment Utility
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

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

In .NET 2.0, Microsoft introduced the Web Site.  This was the default way to create a web Project in Visual Studio 2005.  In Visual Studio 2008, the Web Application has been restored as the default web Project in Visual Studio/.NET 3.x The Web Si…
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…
Internet Business Fax to Email Made Easy - With eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, fr…
This tutorial demonstrates a quick way of adding group price to multiple Magento products.

762 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

14 Experts available now in Live!

Get 1:1 Help Now