Databinding methods such as Eval(), XPath(), and Bind() can only be used in the context of a databound control.
Which i assume has something to do with the 2nd combo rebinding and breaking the binding of the FormView. Have seen this prob around but can find a solution..
Any ideas
Nik
<
<asp:SqlDataSource ID="sqlLevel1" runat="server" ConnectionString="<%$ ConnectionStrings:Database %>" SelectCommand="SELECT Level1 FROM Level1"></asp:SqlDataSource>
<asp:SqlDataSource ID="sqlLevel2" runat="server" ConnectionString="<%$ ConnectionStrings:Database%>" SelectCommand="SELECT Level2 FROM Level2 WHERE Level1 = @Level1"> <SelectParameters> <asp:ControlParameter Name="Level1" ControlID="cmbLevel1" PropertyName="SelectedValue" /> </SelectParameters> </asp:SqlDataSource> </EditItemTemplate> </asp:FormView> <asp:SqlDataSource ID="SqlDataSource1" runat="server" ConnectionString="<%$ ConnectionStrings:Database%>" UpdateCommand="z" />

Databinding methods such as Eval(), XPath(), and Bind() can only be used in the context of a databound control.
Slow
hi, look on this site
http://www.webswapp.com/CodeSamples/aspnet20/FormView1.aspx
Pit
Ronald Cuzco
Hi!
Thanks for asking! I'm a member of the ASP.NET team, and was just popping over here to see what was going on. The best place to ask ASP.NET questions is over on the ASP.NET forums at
http://www.asp.net/welcome.aspx tabindex=1&tabid=39HTH,
PEte
hda
Hi,
I've found a simple solution to Databinding methods such as Eval(), XPath(), and Bind() can only be used in the context of a databound control. Suppose you have these two dropdownlist controls each one into an edittemplate of a detailsview (the first with autopostback):
<EditItemTemplate><asp:DropDownList ID="drpCats" runat="server" AutoPostBack="True" DataSourceID="sqlDSCats" DataTextField="Categoria" DataValueField="CategoriaID" SelectedValue='<%# Bind("CategoriaID") %>'>
</asp:DropDownList> <asp:SqlDataSource ID="sqlDSCats" runat="server" ConnectionString="<%$ ConnectionStrings:SQL2000_FinancialApp %>" SelectCommand="SELECT [CategoriaID], [Categoria] FROM [tbl_Categorias]"></asp:SqlDataSource> </EditItemTemplate> <EditItemTemplate> <asp:DropDownList ID="drpProds" runat="server" DataSourceID="sqlDSProds" DataTextField="Producto" DataValueField="ProductoID" SelectedValue='<%# xx(DataBinder.Eval(Container.DataItem,"ProductoID")) %>' AppendDataBoundItems="False"></asp:DropDownList> <asp:SqlDataSource ID="sqlDSProds" runat="server" ConnectionString="<%$ ConnectionStrings:SQL2000_FinancialApp %>" SelectCommand="SELECT [ProductoID], [Producto] FROM [tbl_Productos] WHERE ([CategoriaID] = @CategoriaID)"> <SelectParameters> <asp:ControlParameter ControlID="drpCats" Name="CategoriaID" PropertyName="SelectedValue" Type="Int64" /> </SelectParameters> </asp:SqlDataSource> </EditItemTemplate>1. Note in the second dropdownlist the SelectedValue Property (<%# xx(.....)%>). "xx" is a function like this:
function xx(ByVal a) as string
return a
end function
2. Taking into account that the eval method is not for two way databinding in edit and insert templates, the DetailsView control doesn't understand that the second dropdownlist is a member field for update. In this sense, you need to manually add an entry to the e.values dictionary into the ItemUpdating event.
Protected Sub DetailsView1_ItemUpdating(.......)
Dim d1 As DropDownList = DetailsView1.FindControl("drpProds")e.NewValues("ProductoID") = d1.SelectedValue
End Sub
Thats all ! simple ! I've found other "over-coded" solutions but takes so long for a simple problem.
CFC2006
Algorith
I'm being bewildered by the same problem for several days.
Would you pls give the detailed description and the source code of this part:
1. Note in the second dropdownlist the SelectedValue Property (<%# xx(.....)%>). "xx" is a function like this:
function xx(ByVal a) as string
return a
end function
Thank you Very much!
Carlos Voltolini Neto
As per the top few posts, this group is for problems with installing and registering the express products, for web development problems you need to post at http://forums.asp.net.