I there
I have a database (sqlserver) holding user information, I just added a field (bit datatype) to enable an administrator to enable or disable a user account let's refer to it as the user status.
I use a formview to pullout the information so far so good, the radiobuttonlist dynamically displays the status of the user, ie the correct button is selected.
The problem I have is that when I press the edit url from the formview I can edit any information about the user but it won't update the user status if when using the radiobuttonlist. No error just that this bit is not updated
Any idea ??
Here is a bit of my code:
Code ASP:<asp:SqlDataSource ID="SqlDS_formview" runat="server" ConnectionString="<%$ ConnectionStrings:IMS_DBConnectionString %>" SelectCommand="SELECT * FROM [tbl_user] INNER JOIN [tbl_department] ON tbl_user.dpt_id = tbl_department.dpt_id WHERE ([user_id] = @user_id)" ConflictDetection="CompareAllValues" OldValuesParameterFormatString="original_{0}" UpdateCommand="UPDATE tbl_user SET user_name = @user_name, user_surname = @user_surname, user_email = @user_email, user_pw = @user_pw WHERE (user_id = @original_user_id) AND (user_name = @original_user_name) AND (user_surname = @original_user_surname) AND (user_email = @original_user_email) AND (user_pw = @original_user_pw)"> <SelectParameters> <asp:QueryStringParameter Name="user_id" QueryStringField="d" Type="Int32" /> </SelectParameters> <UpdateParameters> <asp:Parameter Name="user_name" Type="String" /> <asp:Parameter Name="user_surname" Type="String" /> <asp:Parameter Name="user_email" Type="String" /> <asp:Parameter Name="user_pw" Type="String" /> <asp:Parameter Name="user_active" Type="Boolean" /> <asp:Parameter Name="original_user_id" Type="Int32" /> <asp:Parameter Name="original_user_name" Type="String" /> <asp:Parameter Name="original_user_surname" Type="String" /> <asp:Parameter Name="original_user_email" Type="String" /> <asp:Parameter Name="original_user_pw" Type="String" /> </UpdateParameters> </asp:SqlDataSource> <asp:FormView ID="FormView1" runat="server" DataKeyNames="user_id" DataSourceID="SqlDS_formview" OnItemUpdated="OnRowUpdated"> <EditItemTemplate> <asp:TextBox ID="user_nameTextBox" runat="server" Width="200px" Text='<%# Bind("user_name") %>'></asp:TextBox><strong> User Name</strong><br /> <asp:TextBox ID="user_surnameTextBox" runat="server" Width="200px" Text='<%# Bind("user_surname") %>'></asp:TextBox><strong> User Surname</strong><br /> <asp:TextBox ID="user_emailTextBox" runat="server" Width="200px" Text='<%# Bind("user_email") %>'></asp:TextBox><strong> User Email</strong><br /> <asp:TextBox ID="user_pwTextBox" runat="server" Width="200px" Text='<%# Bind("user_pw") %>'></asp:TextBox><strong>User Password</strong><br /> <br /> <asp:RadioButtonList AutoPostBack="true" ID="user_active" runat="server" Enabled="true" SelectedIndex='<%#Convert.ToInt32(Eval("user_active"))%>'> <asp:ListItem Value="0">Deactivated</asp:ListItem> <asp:ListItem Value="1">Activated</asp:ListItem> </asp:RadioButtonList> <br /> etc....
Thanks for looking I am pretty stuck !
Chris








Bookmarks