I have a form that allows a user to request an update to a customer record based on the customer number. Standard stuff like address and phone number. There are two tables, one for the customer and one for the customer contacts. I am using a dropdownlist to allow the user to select the contact associated to the customer that they want to update.
I am having difficulty getting the contact dropdownlist to rebind with the new contact names if the user enters a different customer number. ex: They entered the wrong customer number.
It simply keeps the contact names of the contacts from the first customer number entered. I've tried a databind on the sqldatasource and on the dropdown list in the button onclick event for the customer number lookup. But still no luck. Any ideas?
Here is what the dropdown list looks like:
<asp:DropDownList ID="DDContactNameaaa" runat="server"
DataValueField="ClcContact" AppendDataBoundItems="true" CssClass="bold" ToolTip="Contact Selection" OnSelectedIndexChanged="DDContactNameaaa_SelectedIndexChanged" AutoPostBack="true">
<asp:ListItem Value="000000000">Add New</asp:ListItem>
Here is the SQLdatasource:
<asp:SqlDataSource ID="SqlDataSourceContactDrop" runat="server"
ConnectionString="<%$ ConnectionStrings:CHILTONMSQLConnectionString %>"
SelectCommand="SELECT ClcCltID, ClcContact, ClcFname, ClcLname, ClcPhone1, ClcPhone2, ClcBeeper, ClcFax, ClcEmail, ClcOther, ClcEmailInv, ClcEmailAR, ClcAddrSameAsClt, Clcaddr1, Clcaddr2, Clcaddr3, Clccity, Clcst, Clczip, Clccountry, ClcInvaddr1, ClcInvaddr2, ClcInvaddr3, ClcInvcity, ClcInvst, ClcInvzip, ClcInvcountry, ClcCategoryId, ClcPhoneSameAsClt, ClcTitle, ClcSal, ClcLname + ', ' + ClcFname AS ContactName FROM ClientContact WHERE (ClcCltID = @formcltid) AND (Deleted = 0) ORDER BY ContactName">
<asp:ControlParameter ControlID="TBClientID" Name="formcltid"
I'm sure there is a simple way of doing this but I have looked in my books and googled for a couple of days and nothing that I've tried works.