Hello guys,how are you?
well im in a bit of trouble,so i want some help.
I´m developing a site in VB.NET that in the beginning the user must login to access other pages.This part is ok,the user logins successfully and goes to members area.In this area,i would like to show in the header,the sentence 'welcome'+username during all the pages that he enters,like for example 'about page' or 'privacy policy page'i would like that if he´s logged in,his username appearing in the header.
I´m not using masterpage.I was using request.querystring to get the value of an early session to the next page,but it´s not working much.

please give me a hand guys! =)

First of all what you need to do, when the User logs in, Carry the Username in the Session variable like this


//if the user is Successfully logged in

Session["Username"]  = txtusername.text;

and in all your other pages , you will probably have a Label that will Display the name of the User who is currently logged in , you would get the value from the Session like this

lblUser.Text   = Session["Username"].Tostring();

And when your user logout of your Session then you need to abandon the session or set it to null

Session["Username"] = null

Hope this Helps


Regards

Vuyiswa Maseko

Yeah Thank you!!!
It´s functioning perfectly now!

Regards!

:) You are Welcome

but everytime when user enter name in textbox the label will show the name of the user....it is wrong only the authenticate user name should display in label

it should work for register page but not in login page

hi VRamone,

may i ask how you validate your user when it log to your page?
im using this statement:
sql = "select userid, status from tblUser where userid='"& struserid &"' and pasword = '"& struserPW &"'"

i dont have an idea on how i will validate it using IF statement
can you help me?

thank you!

it works for me.......... so much thanku

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.