Click here to Skip to main content
15,886,689 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
In login page i have username and password

Username textbox1.text Rakesh
Password textbox1.text


I have employee page in asp.net source as follows

<asp:Panel ID="panel" runat="server">



Employee Id EMP001 Welcome Rakesh Date 23-jan-18 Log out>




i want to display rakesh username from login page to Employee page in P tag.

for that how to do.

What I have tried:

In login page i have username and password

Username textbox1.text Rakesh
Password textbox1.text


I have employee page in asp.net source as follows

<asp:Panel ID="panel" runat="server">
<p color:white">

Employee Id EMP001 Welcome Rakesh Date 23-jan-18 Log out>




i want to display rakesh username from login page to Employee page in P tag.

for that how to do.
Posted
Updated 22-Jan-18 17:31pm

1 solution

First few results from simple google search. "asp.net pass data between pages"
How to: Pass Values Between ASP.NET Web Forms Pages[^]
Passing Data between Pages in ASP.NET[^]
5 ways to send data b/w pages in asp.net[^]
Transferring page values to another page[^]

Quote:
i want to display rakesh username from login page to Employee page in P tag.

add a p tag in the aspx and add runat="server" attribute to the element as
<p id="pid" runat="server"></p>

and access it from c# as
pid.InnerText = "User Name";
 
Share this answer
 
Comments
[no name] 23-Jan-18 0:39am    
when i use pid.innertext = "userName" that username text is display in employee page.

i want to display the login page textbox value Rakesh to employee page.

passing session rakesh value to employee.aspx page.

for that how to do
Karthik_Mahalingam 23-Jan-18 0:49am    
on the button click event get the value from textbox and store it in a session as
session["NameKey"] = textbox1.Text;
and in the page load event of the employee page
read the value from session
string name = session["NameKey"] + "";
pid.innerText = name;
[no name] 23-Jan-18 5:48am    
Thanks it is working fine here
Karthik_Mahalingam 23-Jan-18 5:51am    
if works, Please close this post formally by clicking "Accept answer"
Laxmidhar tatwa technologies 23-Jan-18 10:48am    
a good suggetion

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900