|
code
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Update From DropDownList in DetailViewI have been searching all day... I have an Unbound DropDownList that is in the edit template of a Bound detailview. No matter what I have tried I can not get the Dropdownlist value to update into the database.. I'm sure this has something to do with the finding the control (DDL) in the detailview, but no luck to this point. Any help would be great. Thanks... --Randy Code snipits as follows: <asp:SqlDataSource ID="DSDetail" runat="server" ConnectionString="<%$ ConnectionStrings:ACChangeLogConnectionString %>" SelectCommand="Logdetails" SelectCommandType="StoredProcedure" UpdateCommand="UPDATE ACChange SET acTable = @acTable, Change = @Change, acMandatory = @acMandatory WHERE (UID = @UID)"> <UpdateParameters> <asp:Parameter Name="acTable" /> <asp:Parameter Name="Change" /> <asp:Parameter Name="acMandatory" /> <asp:Parameter Name="UID" /> </UpdateParameters> ............ <asp:DetailsView ID="DVLog" runat="server" AutoGenerateRows="False" CellPadding="4" DataSourceID="DSDetail" ForeColor="#333333" GridLines="None" Height="50px" Width="694px" DataKeyNames="UID"> ......... <EditItemTemplate> <asp:DropDownList ID="acMandatory" SelectValue='<%# Eval("acMandatory") %>' runat="server"> <asp:ListItem Text="Yes" Value="Yes" /> <asp:ListItem Text="No" Value="No" /> </asp:DropDownList> </EditItemTemplate> Try Bind() instead of Eval()
-Brock http://staff.develop.com/ballen Show quoteHide quote > Here is the issue and maybe someone can shed some light on this, since > I have been searching all day... I have an Unbound DropDownList that > is in the edit template of a Bound detailview. No matter what I have > tried I can not get the Dropdownlist value to update into the > database.. I'm sure this has something to do with the finding the > control (DDL) in the detailview, but no luck to this point. Any help > would be great. > > Thanks... > > --Randy > > Code snipits as follows: > > <asp:SqlDataSource ID="DSDetail" runat="server" ConnectionString="<%$ > ConnectionStrings:ACChangeLogConnectionString %>" > SelectCommand="Logdetails" > SelectCommandType="StoredProcedure" UpdateCommand="UPDATE ACChange SET > acTable = @acTable, Change = @Change, acMandatory = @acMandatory > WHERE > (UID = @UID)"> > <UpdateParameters> > <asp:Parameter Name="acTable" /> > <asp:Parameter Name="Change" /> > <asp:Parameter Name="acMandatory" /> > <asp:Parameter Name="UID" /> > </UpdateParameters> > ........... > <asp:DetailsView ID="DVLog" runat="server" AutoGenerateRows="False" > CellPadding="4" > DataSourceID="DSDetail" > ForeColor="#333333" > GridLines="None" Height="50px" > Width="694px" DataKeyNames="UID"> > ........ > <EditItemTemplate> > <asp:DropDownList ID="acMandatory" > SelectValue='<%# Eval("acMandatory") %>' runat="server"> > <asp:ListItem Text="Yes" > Value="Yes" /> > <asp:ListItem Text="No" > Value="No" /> > </asp:DropDownList> > </EditItemTemplate> > I believe I had tryed that and it did not change the outcome..
Brock Allen wrote: Show quoteHide quote > Try Bind() instead of Eval() > > -Brock > http://staff.develop.com/ballen > > > > Here is the issue and maybe someone can shed some light on this, since > > I have been searching all day... I have an Unbound DropDownList that > > is in the edit template of a Bound detailview. No matter what I have > > tried I can not get the Dropdownlist value to update into the > > database.. I'm sure this has something to do with the finding the > > control (DDL) in the detailview, but no luck to this point. Any help > > would be great. > > > > Thanks... > > > > --Randy > > > > Code snipits as follows: > > > > <asp:SqlDataSource ID="DSDetail" runat="server" ConnectionString="<%$ > > ConnectionStrings:ACChangeLogConnectionString %>" > > SelectCommand="Logdetails" > > SelectCommandType="StoredProcedure" UpdateCommand="UPDATE ACChange SET > > acTable = @acTable, Change = @Change, acMandatory = @acMandatory > > WHERE > > (UID = @UID)"> > > <UpdateParameters> > > <asp:Parameter Name="acTable" /> > > <asp:Parameter Name="Change" /> > > <asp:Parameter Name="acMandatory" /> > > <asp:Parameter Name="UID" /> > > </UpdateParameters> > > ........... > > <asp:DetailsView ID="DVLog" runat="server" AutoGenerateRows="False" > > CellPadding="4" > > DataSourceID="DSDetail" > > ForeColor="#333333" > > GridLines="None" Height="50px" > > Width="694px" DataKeyNames="UID"> > > ........ > > <EditItemTemplate> > > <asp:DropDownList ID="acMandatory" > > SelectValue='<%# Eval("acMandatory") %>' runat="server"> > > <asp:ListItem Text="Yes" > > Value="Yes" /> > > <asp:ListItem Text="No" > > Value="No" /> > > </asp:DropDownList> > > </EditItemTemplate> > >
Problems with webcontrol and MultiView
access control in a Repeater from javascript asp.net menu to show only parent, siblings and children as static menus RowDataBound bool to string ObjectDataSource - query being performed twice per page load? Disable a button in Javascript disables server-side code How Do I Pass Bindingsource to Another form. context is null in my TypeConverter.ConvertFrom() method Nested UserControl Problem Treeview contol in asp.net 2.0 with checkboxes |
|||||||||||||||||||||||