?
Solved

binding  combobox cannot save value into the table

Posted on 2008-10-23
2
Medium Priority
?
358 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
2 Comments
 
LVL 10

Accepted Solution

by:
jinn_hnnl earned 1500 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

[Webinar] How Hackers Steal Your Credentials

Do You Know How Hackers Steal Your Credentials? Join us and Skyport Systems to learn how hackers steal your credentials and why Active Directory must be secure to stop them.

Question has a verified solution.

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

One of the pain points with developing AJAX, JavaScript, JQuery, and other client-side behaviors is that JavaScript doesn’t allow for cross domain request for pulling content. For example, JavaScript code on www.johnchapman.name could not pull conte…
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 …
NetCrunch network monitor is a highly extensive platform for network monitoring and alert generation. In this video you'll see a live demo of NetCrunch with most notable features explained in a walk-through manner. You'll also get to know the philos…
Have you created a query with information for a calendar? ... and then, abra-cadabra, the calendar is done?! I am going to show you how to make that happen. Visualize your data!  ... really see it To use the code to create a calendar from a q…
Suggested Courses
Course of the Month10 days, 2 hours left to enroll

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