Hi,
I'm new to ASP.Net 2.0, and I have two pages login.aspx which contain
the membership login control with SQL database, and second page
data.aspx which contain FormView.
I need to use SessionParamete r to pass the UserName and do some
filteration to display the required information.
The fields are UserName, Email.
here is my code in data.aspx.c
public partial class _Default : System.Web.UI.P age
{
protected void Page_Load(objec t sender, EventArgs e)
{
String UserName = Page.User.Ident ity.Name;
Response.Write( UserName);
}
}
regarding the dayasource code in the formview I wrote:
<asp:SqlDataSou rce ID="SqlDataSour ce1" runat="server"
ConnectionStrin g="<%$ ConnectionStrin gs:ASPNETDBConn ectionString %>"
SelectCommand=" SELECT UserName, Email, Phone FROM Data WHERE UserName =
@UserName)">
<SelectParamete rs>
<asp:SessionPar ameter Name="UserName" SessionField="U serName"
Type="String" Size="50" />
</SelectParameter s>
</asp:SqlDataSour ce>
The problem that when I check the session by using
Response.Write( UserName);
it will disply it correctly, but I can't pass it to the SQL and all what
I got is blank page!
Thanx in advance
A. J.
*** Sent via Developersdex http://www.developersdex.com ***