I am trying to use an update panel within an InsertItemTemplate of a Formview. When "Other" is selected from one DropDownlist, another Dropdownlist is hidden. When I remove the update panel this works fine, the record is created no problem. However when the DropDownList is inside an UpdatePanel, I get the following error on inserting :
Oracle.DataAccess.Client.OracleException: ORA-01008: not all variables bound.
I haven't included all of the ASP.NET and code behind, please ask if you'd like to see anything else, there are more bound fields and alot of data validation. Here is part of the ASP.NET:
<asp:Formview
ID="fvJobs"
DataSourceID="fvSqlDataSource"
DataKeyNames="JOB_ID"
DefaultMode="Edit"
OnItemInserting="fvJobs_FileUpl"
OnItemInserted="fvJobs_ItemInserted"
OnItemupdating="fvJobs_FileUp2"
OnItemUpdated="fvJobs_ItemUpdated"
runat="server">
<asp:DropDownList ID="InsertLocList"
SelectedValue='<%# Bind("JOB_LOCATION") %>'
Autopostback="true"
CssClass="ddl"
OnSelectedIndexChanged="InsertLocList_IndexChanged"
RunAt="Server" >
<asp:ListItem Text="--Select One--" Value="-1" />
<asp:ListItem Text="California" Value="CA" />
<asp:ListItem Text="New York" Value="NY" />
<asp:ListItem Text="Pennsylvania" Value="PA" />
<asp:ListItem Text="Texas" Value="TX" />
<asp:ListItem Text="Other" Value="O" />
</asp:DropDownList></label>
<asp:UpdatePanel ID="UpdatePanel1"
UpdateMode="Conditional"
runat="server">
<Triggers>
<asp:AsyncPostBackTrigger ControlID="InsertLocList" />
</Triggers>
<contentTemplate>
<span><asp:label id="InsertCatLbl" runat="server"><b>Subsidiary:</b></asp:label></span>
<asp:DropDownList ID="InsertCatList"
SelectedValue='<%# Bind("JOB_CATEGORY") %>'
CssClass="ddl"
RunAt="Server" >
<asp:ListItem Text="--Select One--" Value="-1" />
<asp:ListItem Text="SRC" Value="SRC" />
<asp:ListItem Text="FRN" Value="FRN" />
<asp:ListItem Text="SUPDIST" Value="SUPDIST" />
<asp:ListItem Text="Stream" Value="STREAM" />
</asp:DropDownList>
</contentTemplate>
</asp:UpdatePanel>
Here is some of the code behind:
Protected Sub InsertLocList_IndexChanged(sender As Object, e As EventArgs)
Dim ddlLoc As DropDownList = _
CType(fvJobs.FindControl("InsertLocList"), DropDownList)
Dim ddlCat As DropDownList = _
CType(fvJobs.FindControl("InsertCatList"), DropDownList)
Dim catLbl As Label = _
CType(fvJobs.FindControl("InsertCatlbl"), Label)
If ddlLoc.SelectedValue = "O"
ddlCat.selectedvalue="SRC"
ddlCat.visible=false
catLbl.visible=false
else
ddlCat.visible = true
catLbl.visible = true
end if
end sub
The strange thing is this works perfectly if I remove the UpdatePanel. I can't figure out why the Bind inside the Update Panel doesn't seem to be working. I've phrased the google searches every way I can think of and I can't seem to find anyone with a similar problem, any help would be greatly appreciated, thanks.
UPDATE
Here is the SqlDataSource for the formview:
<asp:SqlDataSource ID="fvSqlDataSource"
ConnectionString="<%$ ConnectionStrings:Oracle %>"
ProviderName="<%$ ConnectionStrings:Oracle.ProviderName %>"
SelectCommand="SELECT JOB_DESC, JOB_ID, JOB_CATEGORY, JOB_LOCATION, JOB_DATE_BEGIN, JOB_DATE_CLOSED, JOB_FILENAME, JOB_SHOW_INDIC from JOB_POSTING WHERE JOB_ID = :JOB_ID"
RunAt="server"
UpdateCommand="UPDATE JOB_POSTING SET JOB_DESC=:JOB_DESC, JOB_LOCATION=:JOB_LOCATION, JOB_CATEGORY=:JOB_CATEGORY, JOB_DATE_BEGIN=TO_DATE(:JOB_DATE_BEGIN, 'MM/DD/YYYY'), JOB_DATE_CLOSED=TO_DATE(:JOB_DATE_CLOSED, 'MM/DD/YYYY'), JOB_FILENAME=:JOB_FILENAME,JOB_SHOW_INDIC=:JOB_SHOW_INDIC WHERE JOB_ID=:JOB_ID"
InsertCommand="INSERT INTO JOB_POSTING(JOB_DESC, JOB_ID, JOB_LOCATION, JOB_CATEGORY, JOB_DATE_BEGIN, JOB_DATE_CLOSED, JOB_FILENAME, JOB_SHOW_INDIC)
VALUES
(:JOB_DESC, :JOB_ID, :JOB_LOCATION, :JOB_CATEGORY, TO_DATE(:JOB_DATE_BEGIN, 'MM/DD/YYYY'), TO_DATE(:JOB_DATE_CLOSED, 'MM/DD/YYYY'), :JOB_FILENAME, :JOB_SHOW_INDIC)"
>
<SelectParameters>
<asp:Parameter Name="JOB_ID" Type="String" DefaultValue="0" />
</SelectParameters>
<UpdateParameters>
<asp:parameter Name="JOB_ID" Type="String" DefaultValue="0"/>
</UpdateParameters>
</asp:SqlDataSource>