I have 5 web pages. I have 5 separate submit buttons on these pages. Happens such that when the user clicks submit on the respective page the information is get from the text box and stored in the variables like:
Suppose:
static public String DOB;
static public String CNIC;
static public String Domicile;
static public String Dependents;
Gender = DropDownList8.SelectedItem.Text;
Nationality = DropDownList8.SelectedItem.Text;
Maritial_Status = DropDownList2.SelectedItem.Text;
DOB = TextBox9.Text;
Like this i have different variables on first 4 pages and i want to access all of them on the last page.
I have to use all of these variables to commit insertion command through query so it means i need all of my variables to be provided for the insert command!
Kindly tell me an easy way how can i accomplish this!
You can accomplish this by below steps
– create a class called which handles all your variables which needs to be put in the session
and create properties like below
-After this access the properties from your aspx pages , before doing that reference this class by ‘using’ statement in the respective codebehind of aspx pages like below
// The below code can be written in the aspx code behind
-and when you are accessing this in the last page you can pass the parameters to your insert method for example
//calling the method
like above
Hope you understood how to use it.
Regards
Srividhya