Click here to Skip to main content
15,895,011 members
Please Sign up or sign in to vote.
5.00/5 (3 votes)
See more:
I need to confirm only modified values before save in second page so i get to know what is really changed in page before sending it to save in Asp .Net.

What I have tried:

Need a solution from professionals
Posted
Updated 23-Oct-16 20:57pm
Comments
Suvendu Shekhar Giri 24-Oct-16 1:51am    
Where is the relevant code?
What have you tried so far?
shaprpuff 24-Oct-16 2:28am    
I need to save 40 controls in session to retrieve to the next page for this i have a class but dont know how to make Session["abc"] as StudentsClass(); so i can easily save
Session["abc"].name=txtbox1.Text;
Session["abc"].RollNumber=txtbox2.Text;

and Retrieve like,

string value1=Session["abc"].name;
string value2=Session["abc"].RollNumber;

Suvendu Shekhar Giri 24-Oct-16 2:58am    
please check the solution, if it helps :)

1 solution

You can save the values to object of an class and then the object to the session. Then later you can retrieve the object from session.

Example:
C#
Student objStudent=new Student(); //initialize your actual class
objStudent.Name=txtbox1.Text;
objStudent.RollNumber=txtbox2.Text;

Session["student"] = objStudent;

You retrieve data back from session like-
C#
Student objNewStudent=(Student) Session["student"];

Now you can use the properties as required.

Hope, it helps :)
 
Share this answer
 
v2

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