Hi,
I've got made some changes in user.ascx and user.ascx.vb to create 2 extra field to create a relation in a new table between the dnn UserId and the intern customer or employee id.
I've got the add and delete function working perfectly.
Only when i'm try to update it the change is reset before the update statements runs.
in the User.axcx i've created a extra asp:panel
asp:panel id="pnlAddRelation" runat="server" Visible="True">
<table id="tblUserType" runat="server" width="350">
<tr height="25">
<td width="133" class="subhead"><dnn:label id="plUserType" runat="server" controlname="chkTypeUser" /></td>
<td width="175" class="normalTextBox"><asp:DropDownList id="chkTypeUser" runat="server" Enabled="false"/>
<asp:Image ID="Image1" ImageUrl="~/images/required.gif" BorderStyle="None" runat="server"/></td>
</tr><tr>
<td width="133" class ="subhead">
<asp:label ID="valUserType" runat="Server" CssClass="NormalRed" />
</td >
</tr >
<tr height ="25"> <td width="133" class="subhead"><dnn:label id="plUserID" runat="server" controlname="txtUserID"/></td > <td width="175"><asp:TextBox id="txtUserID" runat="server" CssClass="NormalTextBox" size="20" maxlength="20"></asp:TextBox > <asp:Image ID="Image2" ImageUrl="~/images/required.gif" BorderStyle="None" runat="server"/></td > </tr > <tr > <td width="133" class ="subhead"> <asp:label ID="valUserID" runat="Server" CssClass="NormalRed" /> </td > </tr > </table >
asp:panel>
In the user.ascx.vb i've edit in the DataBind()
Dim UserRelID As Integer = UserController.GetUserRelID(User.UserID)Dim ingesteld As Boolean If chkTypeUser.Items.Count = 0 Then
chkTypeUser.Items.Add(
chkTypeUser.Items.Add(
chkTypeUser.Items.Add(
"")"Medewerker")"Klant/Leverancier")End If If Not ingesteld Then If UserRelID < 0 Then
UserRelID = UserRelID * -1
chkTypeUser.Items(1).Selected =
True
txtUserID.Text = UserRelID
ElseIf UserRelID > 0 Then
chkTypeUser.Items(2).Selected =
True
txtUserID.Text = UserRelID
End If
ingesteld =
True End If
When i leave the if not ingesteld statement i can update so the rest is working. Only when this statement is standing there the data is read out the db but when i'm change it and click on update it gets resets before its get writing in the db.
I'm really confised and can't find where the data gets reset. Can anyone help me?