Databound Countrols Inside UpdatePanel Not Saving To Database

Currently working with the EditItemTemplate section of a FormView Control.  Using AJAX to auto-populate State and County based on ZIP Code entered.  The AJAX functionality works fine, but when I click save nothing (or empty strings) gets saved to the dabase.  When I pull up the form again all fields inside the updatepanesl are blank. This form was working/saving fine before I introduced the AJAX...
<table width="100%" cellpadding="0" cellspacing="0">
    <tr>
        <td style="padding-top:6px" width="50%">
            <a class="TextLabel">State/Zip</a><br />
            <asp:UpdatePanel id="UpdatePanel1" runat="server">
                <contenttemplate>
            <asp:SqlDataSource ID="sqlState" runat="server" ConnectionString="<%$ConnectionStrings:NICASConnectionString %>"
                SelectCommand="SELECT DISTINCT state FROM Locale ORDER BY state">
            </asp:SqlDataSource>
            <asp:DropDownList ID="cboState" runat="server" CssClass="TextBox" DataSourceID="sqlstate" DataValueField="state" DataTextField="state" selectedvalue='<%# Bind("state") %>' AppendDataBoundItems="true" AutoPostBack="false" OnSelectedIndexChanged="ClearCounty">
                <asp:ListItem value="" Text=""></asp:ListItem>
            </asp:DropDownList>
            <asp:TextBox ID="txtZip" runat="server" CssClass="TextBox" Width="60px" MaxLength="10" Text='<%# Bind("zip") %>' AutoPostBack="true" OnTextChanged="txtZip_TextChanged"></asp:TextBox>
            </contenttemplate>
                <Triggers>
                    <asp:AsyncPostBackTrigger ControlID="txtZip" EventName="TextChanged" />
                </Triggers>
            </asp:UpdatePanel>
        </td>
        <td style="vertical-align:top"; width="50%">
            <a class="TextLabel">County</a>&nbsp;
            <br />
            <asp:UpdatePanel ID="UpdatePanel2" runat="server">
                <ContentTemplate>
            <asp:SqlDataSource ID="sqlCounty" runat="server" ConnectionString="<%$ ConnectionStrings:NICASConnectionString %>" 
                SelectCommand="SELECT county FROM Locale WHERE state=@state ORDER BY county">
                <SelectParameters>
                    <asp:ControlParameter ControlID="fvLoc$cboState" PropertyName="SelectedValue" Name="state" Type="string" />
                </SelectParameters>     
            </asp:SqlDataSource>
            <asp:DropDownList ID="cboCounty" runat="server" CssClass="TextBox" AutoPostBack="True" DataSourceID="sqlCounty" DataTextField="county" DataValueField="county" AppendDataBoundItems="true" OnSelectedIndexChanged="SetWorkunit">
                <asp:ListItem Value="" Text=""></asp:ListItem>
            </asp:DropDownList>
                </ContentTemplate>
                <Triggers>
                    <asp:AsyncPostBackTrigger ControlID="txtZip" EventName="TextChanged" />
                </Triggers>
            </asp:UpdatePanel>
        </td>
    </tr>
</table>

Open in new window

synapse88Asked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

cciservicesCommented:
This one can be tricky, but sometimes I have been required to put the: UpdateMode="Conditional" in the Update Panel.  Just a thought....
0
synapse88Author Commented:
I figured it out.  Just have to use something like e.NewValues.Item("state") = CType(fvLoc.FindControl("cboState"), DropDownList).SelectedValue in the itemupdating event.
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
cciservicesCommented:
Ah, good one.  That actually helps me out as well.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
ASP.NET

From novice to tech pro — start learning today.