By default the first item of a dropdown is selected. try setting the selectedindex of the dropdown to -1 before adding the new item...
protected void bttnaddck_Click (object sender, EventArgs e)
{
DropDownList1.S electedIndex = -1;
DropDownList1.I tems.Add(ListBo x1.SelectedItem );
ListBox1.Items. Remove(ListBox1 .SelectedItem);
}
User Profile
Collapse
-
could you provide the page too, so I can see what the code behind is working with?Leave a comment:
-
-
They are the same thing. "string" is a C# keyword/alias for .NET type "System.String" . It is up to the developer which they use. Some developers who work in team environments like to use the .NET type so that others who reference their code, but may be developing in a different language can still understand their code. This is the same as using "int" instead of "Int32", or "bool" instead of "Boolean"....Leave a comment:
-
jQuery UI Autocomplete not passing correct querystring to ashx...
Setup: I have a RadioButtonList with two listitems (One Street, the other Schools). These define what type of search I want. I textbox with associated autocomplete. First you select which search to complete, and then start typing and the autocomplete will make suggestions. Autocomplete goes out to ashx webservice which pulls a list from the database.
I have tested the webserver and it works properly, so I'm thinking the problem... -
@ ck9663 - I used your first option, and it looks to be working as I needed... Thanks!Leave a comment:
-
I don't see how an inner join will help with my situation. I want to save a string (like an array of results) to one field in the database. Then I want to be able to use that string for my WHERE IN statement. I need to know how to format that string when I save it so I can use it in my SELECT WHERE IN statement... I have to save the results in the table so users can see their search results 6 months from nowLeave a comment:
-
I need it for saved search results. There are many more fields a person will be able to search by as well... I just did this as a simple example of what I am looking for. I am saving the search results because the items in the tables change so frequently.
Basically I just want a person to be able to fill out their search fields, perform the search, and save the results in a table -- which I can use later to display the results...Leave a comment:
-
How to Save results from query in field for WHERE IN statement
I would like to query a table, and save the results into 1 field of a results table as below:
Table1:
StudentID FirstName LastName
JOHND John Doe
JANED Jane Doe
ROJERD Rojer Doe
JOHNNYJ Johnny Johnson
Table2:
SearchId Results
1 JOHND, JANED, ROJERD
Table 2 populated by 2 queries
SELECT StudentID...
No activity results to display
Show More
Leave a comment: