A
Abraham Andres Luna
hello everyone,
does anyone know why i can't access the
HttpContext.Current.User.Identity.Name property in a .cs file?
this is the index.aspx page:
<%@ Page Language="C#" %>
<script runat="server">
void Page_Load(Object Sender, EventArgs E)
{
FormsAuthentication.SetAuthCookie("abe", false);
lblError.Text = IS.Data.GetUSRNA();
}
</script>
<html>
<head runat="server">
<title>Untitled Page</title>
</head>
<body>
<form runat="server">
<asp:Label ID="lblError" runat="server" />
</form>
</body>
</html>
and this is the .cs file located in the app_code directory:
using System;
using System.Web;
namespace IS
{
public class Data
{
public static string GetUSRNA()
{
return HttpContext.Current.User.Identity.Name;
}
}
}
it doesn't make sense why i wouldn't be able to retreive the user name this
way. maybe i'm missing something.
thank you for your help
does anyone know why i can't access the
HttpContext.Current.User.Identity.Name property in a .cs file?
this is the index.aspx page:
<%@ Page Language="C#" %>
<script runat="server">
void Page_Load(Object Sender, EventArgs E)
{
FormsAuthentication.SetAuthCookie("abe", false);
lblError.Text = IS.Data.GetUSRNA();
}
</script>
<html>
<head runat="server">
<title>Untitled Page</title>
</head>
<body>
<form runat="server">
<asp:Label ID="lblError" runat="server" />
</form>
</body>
</html>
and this is the .cs file located in the app_code directory:
using System;
using System.Web;
namespace IS
{
public class Data
{
public static string GetUSRNA()
{
return HttpContext.Current.User.Identity.Name;
}
}
}
it doesn't make sense why i wouldn't be able to retreive the user name this
way. maybe i'm missing something.
thank you for your help