Click here to Skip to main content
15,884,176 members
Home / Discussions / ASP.NET
   

ASP.NET

 
AnswerRe: how can get the birthday from database to dropdownlist Pin
Blue_Boy4-May-11 21:07
Blue_Boy4-May-11 21:07 
GeneralRe: how can get the birthday from database to dropdownlist Pin
lolostar4-May-11 23:41
lolostar4-May-11 23:41 
GeneralRe: how can get the birthday from database to dropdownlist Pin
Blue_Boy4-May-11 23:52
Blue_Boy4-May-11 23:52 
GeneralRe: how can get the birthday from database to dropdownlist Pin
Not Active5-May-11 2:08
mentorNot Active5-May-11 2:08 
GeneralRe: how can get the birthday from database to dropdownlist Pin
Blue_Boy5-May-11 4:49
Blue_Boy5-May-11 4:49 
AnswerRe: how can get the birthday from database to dropdownlist Pin
Sneha Bisht5-May-11 23:21
Sneha Bisht5-May-11 23:21 
GeneralRe: how can get the birthday from database to dropdownlist Pin
lolostar6-May-11 0:23
lolostar6-May-11 0:23 
QuestionLog In Page in ASP.NET with User Type [modified] Pin
GAiXz4-May-11 4:18
GAiXz4-May-11 4:18 
HELLO EVERYONE

first.. i have a database...

dbName: Database
tblName: tblUser
FieldNames: UserID, UserPassword, UserType

example:

alc14647, 12345, admin
bti12345, 67890, user
ggt09876, 45673, editor
blah blah blah

my question is... how do i enabled or hide ex.[buttons or lables]
if the user type is logged in?

i have a SEPARATE LOG IN PAGE, and a MASTER PAGE for my layout and the other page is selected MASTER PAGE for the CONTENTS

ex. admin can see or enable to use a certain buttons or lables
and the user can only use or see a specific labels or buttons after log in,

my buttons or labels are

LABEL1
LABEL2
LABEL3
LABEL4
LABEL5
LABEL6
LABEL7
LABEL8
LABEL9

all the labels can see the ADMIN in the MASTER PAGE note[that labels is isn't the ContentPageHolder, i put it in the OUTSIDE]
and the other user can SEE that labels on their SPECIFIC type,

this my CODE for my SEPARATED Log in page and it's in the same project located also[hope you'v gonna get it^_^]

Imports System.Data.OleDb

Partial Class _Default
    Inherits System.Web.UI.Page
    Dim cn As New OleDbConnection
    Dim cmd As New OleDbCommand
    Dim dr As OleDbDataReader

Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
        txtUsername.Focus()
        Label1.Text = ""
        Try
            With cn
                If .State = Data.ConnectionState.Open Then .Close()
                .ConnectionString = "Provider=microsoft.jet.oledb.4.0;data source=" & Server.MapPath("data\database.mdb")
                .Open()
            End With
        Catch ex As Exception
            MsgBox(ex.Message.ToString)
        End Try
    End Sub

Protected Sub btnLogin_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnLogin.Click
        If txtUsername.Text = "" Or txtPassword.Text = "" Then Exit Sub
        With cmd
            .CommandText = "Select * from tbluser Where userid = '" & Trim(txtUsername.Text) & "' and passid = '" Trim(txtPassword.Text) &"' "
            .Connection = cn
            dr = .ExecuteReader
        End With

        If dr.HasRows Then
            Session("name") = txtUsername.Text 'it will display o the other page, it depends 
            Response.Redirect("Main.aspx") 'my main.aspx is connected to my MASTER PAGE and all the other page
        Else
            Label1.Text = ("ERROR! " & txtUsername.Text)
        End If
    End Sub
End Class


what code i'm gonna suppose to do? and where i'm gonna put it??

please.. i need some help...
just to enabled, disabled, visible = TRUE or FALSE the specific ITEM like BUTTONS and LABELS that depends on the USERTYPE...

thank for READING i hope READER's can HELP ME..
THANKS in ADVANCE ^_^




modified on Wednesday, May 4, 2011 10:26 AM

AnswerDuplicate question Pin
thatraja4-May-11 5:26
professionalthatraja4-May-11 5:26 
AnswerRe: Log In Page in ASP.NET with User Type [modified] Pin
Sandeep Mewara4-May-11 6:32
mveSandeep Mewara4-May-11 6:32 
GeneralRe: Log In Page in ASP.NET with User Type Pin
AspDotNetDev4-May-11 6:47
protectorAspDotNetDev4-May-11 6:47 
GeneralRe: Log In Page in ASP.NET with User Type Pin
Sandeep Mewara4-May-11 6:50
mveSandeep Mewara4-May-11 6:50 
Questionhelp me in creating live video chat in asp.net...... Pin
abhijeet66564-May-11 1:29
abhijeet66564-May-11 1:29 
AnswerRe: help me in creating live video chat in asp.net...... Pin
Not Active4-May-11 2:08
mentorNot Active4-May-11 2:08 
GeneralRe: help me in creating live video chat in asp.net...... Pin
Ravi Sant4-May-11 6:04
Ravi Sant4-May-11 6:04 
GeneralRe: help me in creating live video chat in asp.net...... Pin
Not Active4-May-11 6:10
mentorNot Active4-May-11 6:10 
AnswerRe: help me in creating live video chat in asp.net...... Pin
Sandeep Mewara4-May-11 6:39
mveSandeep Mewara4-May-11 6:39 
Questionhow can i add buttonfield in gridview ? Pin
buffering833-May-11 20:58
buffering833-May-11 20:58 
AnswerRe: how can i add buttonfield in gridview ? Pin
Parwej Ahamad4-May-11 0:17
professionalParwej Ahamad4-May-11 0:17 
AnswerRe: how can i add buttonfield in gridview ? Pin
Ravi Sant5-May-11 0:31
Ravi Sant5-May-11 0:31 
Questionindex outside the bounds of the array Pin
Ramkumar_S3-May-11 15:46
Ramkumar_S3-May-11 15:46 
AnswerRe: index outside the bounds of the array Pin
Prasanta_Prince4-May-11 1:13
Prasanta_Prince4-May-11 1:13 
QuestionSearching the numeric value in a gridview Pin
amina893-May-11 0:41
amina893-May-11 0:41 
AnswerRe: Searching the numeric value in a gridview Pin
Ravi Sant3-May-11 0:53
Ravi Sant3-May-11 0:53 
GeneralRe: Searching the numeric value in a gridview Pin
amina893-May-11 4:21
amina893-May-11 4:21 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.