Master page?
-
Hi friends , I have to add some features in my project. If a user logs in, their log in name will be appear in the master page so that it can be viewed throughout the project. How to do it? Can anyone will guide?
-
Hi friends , I have to add some features in my project. If a user logs in, their log in name will be appear in the master page so that it can be viewed throughout the project. How to do it? Can anyone will guide?
Buy an ASP.NET book and read it. Make sure you read the chapter on the session object.
Christian Graus Driven to the arms of OSX by Vista.
-
Hi friends , I have to add some features in my project. If a user logs in, their log in name will be appear in the master page so that it can be viewed throughout the project. How to do it? Can anyone will guide?
Hi, Inorder to display the login name of the user: 1.First, add a master page and include all the child pages for it. 2.Put the control u wish to display in every page outside content page(if u put the control in it, u cud c tat only in the master page) 3. Aftr a user logs in , the username shud b got into a Session variable (eg: Session["uname"]= username ) and this session var.'s value is assigned to the control(eg:label) Bingo ! there goes the question. Good Luck!!
-
Buy an ASP.NET book and read it. Make sure you read the chapter on the session object.
Christian Graus Driven to the arms of OSX by Vista.
I store the user name in a session variable. My question is how to display it in the Master page when Login button is clicked?
-
Hi friends , I have to add some features in my project. If a user logs in, their log in name will be appear in the master page so that it can be viewed throughout the project. How to do it? Can anyone will guide?
-
to display user name in master page. just put one lable in master page and in master page Page_load event. just assign the session to lable ex: lblusername.text=Session["username"];
I did it as u told Like user.text = Session["pho"].ToString(); But during runtime it assign the master page variable first and give a error called Use the new keyword to create an object instance. can u correct it?
-
I did it as u told Like user.text = Session["pho"].ToString(); But during runtime it assign the master page variable first and give a error called Use the new keyword to create an object instance. can u correct it?
-
I store the user name in a session variable. My question is how to display it in the Master page when Login button is clicked?
Karthick_gc wrote:
My question is how to display it in the Master page when Login button is clicked?
As CG said, please get a good book and work with the examples.
Navaneeth How to use google | Ask smart questions
-
I did it as u told Like user.text = Session["pho"].ToString(); But during runtime it assign the master page variable first and give a error called Use the new keyword to create an object instance. can u correct it?
I am again suggesting you please buy a Basic ASP.Net Book Or Please read some Article on Session.
cheers, Abhijit CodeProject MVP
-
I did it as u told Like user.text = Session["pho"].ToString(); But during runtime it assign the master page variable first and give a error called Use the new keyword to create an object instance. can u correct it?
Session["pho"] is equal to null. You may not have set it. Just put a null check in there:
if(Session["pho"] != null)
{
user.Text = Session["pho"].ToString();
}Either way, this shows a lack of knowledge. Try to read as much as you can on ASP.Net. Look into coding Windows applications first; that will set the ground work for a basic grasp of C#, and the basic rules of the .Net Framework