Link to home
Start Free TrialLog in
Avatar of Ennio
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.
ASKER CERTIFIED SOLUTION
Avatar of Jeff Certain
Jeff Certain
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Ennio
Ennio

ASKER

So I got a book here but It's not a good one..

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...)
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of Ennio

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.OleDb" %>
<%@ Import Namespace="System.Web.Security" %>
<!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.Text = "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>




Avatar of Ennio

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.txtfname' 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.Text = "Ennio"
Line 10:             
Line 11:             myConn.Close()