i am using Visual Studio 2010 professional and SQL server 2008 R2 express
what i am trying to do is detect who is the logged in user and display their detail in a gridview. the logged in user has used asp.net authentication, i have allowed users to access the page using the login process, they have the "user" role set to allow. the admin account can view all users in the account from a gridview, but i also want a logged in user to see their own details in the members section.
this is shown in the code-behind
Protected Sub Page_Load(sender As Object, e As System.EventArgs)
Session("MemberDetails") = User.Identity.Name
End Sub
this is in the main page
<asp:Gridview>
<Columns>
<asp:BoundField DataField="username" HeaderText="username" />
<$ many more fields here--$>
</Columns>
</asp:GridView>
<asp:SqlDataSource ID="SqlDataSource1" runat="server"
ConnectionString="<%$ ConnectionStrings:ConnectionString %>"
SelectCommand="SELECT username, salutation, fname, sname, address, suburb, postcode, dayphone FROM member WHERE (username = @username)">
<SelectParameters>
<asp:SessionParameter Name="username" SessionField="MemberDetails" />
</SelectParameters>
</asp:SqlDataSource>
all of it should work but instead i get a blank page.