Hi,
can anyone help with the following...
I have 2 pages (login.aspx and accschk.aspx) and they work fine.
accschk.aspx
---------------
<%@ Page Language="
VB" %>
<script runat="server">
' Insert page code here
'
Sub Page_Load(Src As Object, E As EventArgs)
Response.Write (User.Identity.Name & "<br />")
End Sub
</script>
<html>
<head>
</head>
<body>
<form runat="server">
</form>
</body>
</html>
i.e. when run the user enters his login name, and then accschk.aspx displays the login name. It works ok.
I then decided to incorporate the above into an ascx, and changed the code as follows...
accschk.ascx
---------------
<%@ Control Language="
VB" %>
<script runat="server">
' Insert user control code here
'
Sub Page_Load(Src As Object, E As EventArgs)
Response.Write (User.Identity.Name & "<br />")
End Sub
</script>
accschk.aspx
---------------
<%@ Page Language="
VB" %>
<%@ Register TagPrefix="uc0" TagName="haccschk" Src="accschk.ascx" %>
<script runat="server">
' Insert page code here
'
</script>
<html>
<head>
</head>
<body>
<form runat="server">
</form>
</body>
</html>
Now I get an error in the ascx file.
Error
------
Compiler Error Message: BC30451: Name 'User' is not declared.
Source Error:
Line 6: '
Line 7: Sub Page_Load(Src As Object, E As EventArgs)
Line 8: Response.Write (User.Identity.Name & "<br />")
Line 9: End Sub
Line 10:
Can anyone help?
Rgds Ian