View Complete Post
I have a weird problem...
I have a web part form, with one of the dropdownlist, when referenced in code behind, happes to be null.
Common.bindMultiChoices(ddlPly4, oEnquiriesList, "Ply 4 Type (Paper)", "Select Ply 4", null);
But at front user control file, I do have:
<tr><td><asp:DropDownList ID="ddlPly4" runat="server" AutoPostBack="true" OnSelectedIndexChanged="ddlPly4_OnSelectedIndexChanged" /&
Here's what I have. I was able to debug and traverse through the webservice and return teh array back into the first call method of: return new CarsService().. But back in the page_load method, I can't get it to update and show up in the page. what am I doing wrong?!?!
<asp:UpdatePanel ID="UpdatePanel2" runat="server" UpdateMode="Conditional"> <ContentTemplate> <cc1:CascadingDropDown ID="CascadingDropDown1" runat="server" TargetControlID="DropDownList1" Category="Make" PromptText="Please select a make" LoadingText="[Loading makes...]"
The script I am using is
On my formview I have a drop down list that is populated with the names of the files in a certain directory. This works fine, but when the drop down list selected value is bound to the database field I get the following error :
'ImageFileDropDownList' has a SelectedValue which is invalid because it does not exist in the list of items.Parameter name: value
I have setup other drop down lists in the same formview populated from SqlDataSources and these all work fine. I can see perhaps why this is an issue because I have not specified a DataValueField or a DataTextField for this drop down that is populated in code (whereas I can for the SQL bound ones) because I'm not sure what these settings would be.
I need to have a "blank" option as well so that the field does not default to the first value in the list.
My code (I have stripped out some meaningless controls) :
<asp:FormView ID="FormView1" runat="server" DataKeyNames="BannerID" DataSourceID="SqlDataSource2" OnItemDeleted="FormView1_ItemDeleted">
<table width="100%" cellspacing="0" cellpadding="4">
i have two radio button list on my page
on my Frist Index there is a panel with Drop Down List
and on Second Index there is a static variable in which i am storing value as Pending
now as soon as i select my Second RadioButtonList it also stores the DropDown List Value
how i can clear the DropDown List Value?
protected void Button2_Click(object sender, EventArgs e)
string day = DropDownList1.SelectedItem.Text;
string day1 = DropDownList4.SelectedItem.Text;
string month = DropDownList2.SelectedItem.Text;
string month1 = DropDownList5.SelectedItem.Text;
string year = DropDownList3.SelectedItem.Text;
string year1 = DropDownList6.SelectedItem.Text;
string date1 = day + "/" + month + "/" + year;
string date2 = day1 + "/" + month1 + "/" + year1;
DataSet ds = new DataSet();
ds = ob.GetDate_Search("Death Certificate", pending, date1, date2);
GridView1.DataSource = ds;
protected void RadioButtonList1_SelectedIndexChanged(object sender, EventArgs e)
if (RadioButtonList1.SelectedIndex == 0)
pending = "Pending&quo