0

I am trying to put the UserName of the authenticated user on an Insert item template. I need the easiest explanation since I am very new. I really appreciate your help. This is what I have:

    <InsertItemTemplate>
         <asp:LoginName ID="LoginName2" runat="server" User.Identity.Name='<%# Bind("UserName") %>'/>
    </InsertItemTemplate>

Thanks

Jose

1 Answers1

0

Do this from the codebehind

<asp:DetailsView ID="DetailsView1" runat="server" OnDataBound="DetailsView1_DataBinding">
<InsertItemTemplate>
     <asp:LoginName ID="LoginName2" runat="server" />
</InsertItemTemplate>    
</asp:DetailsView>


Protected Sub DetailsView1_DataBinding(ByVal sender As Object, ByVal e As System.EventArgs) Handles DetailsView1.DataBinding

LoginName2.text =User.Identity.Name

End Sub
Tim Cadieux
  • 447
  • 9
  • 21