Ennio
asked on
Display differnt links to different users
I would like some help on how can I displat different links to different user.
Ex. If you go to my website, you should not be able to see the link edit profile, unless you login. And I have 2 differents type of user, and they should have different links.
I'm using access db.
Ex. If you go to my website, you should not be able to see the link edit profile, unless you login. And I have 2 differents type of user, and they should have different links.
I'm using access db.
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
ASKER
I'm getting this error using .ascx file
I have a page_load that need to popula some fields that are in my .ascx file (CAN I DO THAT?)
I'm posting my codes here.
************************** ********** ********** ***
My .ASCX file (this is just a test, so I only have these 2 fields)
First Name: <asp:TextBox ID="txtfname" runat="server" /><br />
Last Name: <asp:TextBox ID="txtlname" runat="server" /><br />
************************** ********** ********** ****
My aspx page
<%@ Page Language="VB" ContentType="text/html" ResponseEncoding="iso-8859 -1" %>
<%@ Register TagPrefix="bsf" TagName="babysitterform" src="babysitter.ascx" %>
<%@ Import Namespace="System.Data" %>
<%@ Import Namespace="System.Data.Ole Db" %>
<%@ Import Namespace="System.Web.Secu rity" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<script language="vb" runat="server">
Sub Page_Load( S As Object, E As EventArgs)
If Not isPostBack Then
Dim myConn As OleDbConnection
Dim myComm As OleDbCommand
Dim myData As OleDbDataReader
myConn = New OleDbConnection("Provider= Microsoft. Jet.OLEDB. 4.0; Data Source=" & Server.MapPath("/database/ babysitter .mdb") & ";")
myConn.Open()
babysitterform1.txtfname.T ext = "Ennio"
myConn.Close()
End If
End Sub
</script>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>Untitled Document</title>
</head>
<body>
<form runat="server">
<bsf:babysitterform ID="babysitterform1" runat="server" />
</form>
</body>
</html>
I have a page_load that need to popula some fields that are in my .ascx file (CAN I DO THAT?)
I'm posting my codes here.
**************************
My .ASCX file (this is just a test, so I only have these 2 fields)
First Name: <asp:TextBox ID="txtfname" runat="server" /><br />
Last Name: <asp:TextBox ID="txtlname" runat="server" /><br />
**************************
My aspx page
<%@ Page Language="VB" ContentType="text/html" ResponseEncoding="iso-8859
<%@ Register TagPrefix="bsf" TagName="babysitterform" src="babysitter.ascx" %>
<%@ Import Namespace="System.Data" %>
<%@ Import Namespace="System.Data.Ole
<%@ Import Namespace="System.Web.Secu
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<script language="vb" runat="server">
Sub Page_Load( S As Object, E As EventArgs)
If Not isPostBack Then
Dim myConn As OleDbConnection
Dim myComm As OleDbCommand
Dim myData As OleDbDataReader
myConn = New OleDbConnection("Provider=
myConn.Open()
babysitterform1.txtfname.T
myConn.Close()
End If
End Sub
</script>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<title>Untitled Document</title>
</head>
<body>
<form runat="server">
<bsf:babysitterform ID="babysitterform1" runat="server" />
</form>
</body>
</html>
ASKER
and here is the error
Compilation Error
Description: An error occurred during the compilation of a resource required to service this request. Please review the following specific error details and modify your source code appropriately.
Compiler Error Message: BC30390: '_ASP.babysitter_ascx.txtf name' is not accessible in this context because it is 'Protected'.
Source Error:
Line 7: myConn = New OleDbConnection("Provider= Microsoft. Jet.OLEDB. 4.0; Data Source=" & Server.MapPath("/database/ babysitter .mdb") & ";")
Line 8: myConn.Open()
Line 9: babysitterform1.txtfname.T ext = "Ennio"
Line 10:
Line 11: myConn.Close()
Compilation Error
Description: An error occurred during the compilation of a resource required to service this request. Please review the following specific error details and modify your source code appropriately.
Compiler Error Message: BC30390: '_ASP.babysitter_ascx.txtf
Source Error:
Line 7: myConn = New OleDbConnection("Provider=
Line 8: myConn.Open()
Line 9: babysitterform1.txtfname.T
Line 10:
Line 11: myConn.Close()
ASKER
So I should create a ascx file for each one action I want to happened (like if a user is a guest do not display any link, if the user is level 1 display some link,etc...)