Click here to Skip to main content
15,905,028 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
hi,
I am working on marriage portal and there are 7 steps for registration e.g. personal details, physical attributes, family details, educational detail etc. each having next button till last one i.e. congratulation page.


now i want to know that how to move variables from one form to another form where and how implement insert command either on last last page button event or at each submit button.

but i want to insert all the fields in one table i.e. registration table.
Posted
Comments
Azee 8-Oct-13 2:18am    
Windows? Asp.net? mention the framework please
Member 10195092 8-Oct-13 2:23am    
asp.net with sql
Shubh Agrahari 8-Oct-13 2:33am    
so what is a problem in asp.net.....

just use Sessions it helps better
Thanks7872 8-Oct-13 2:45am    
Don't use different pages. Use MultiView in page. Each view may contain one section e.g. personal details. After user fills up necessary details and click button change view accordingly.
Member 10195092 8-Oct-13 3:05am    
but when i'm using any textbox in it, it's showing an error "Error creating "

use multiview and view concept all details like personal details, physical attributes, family details, educational detail put in separate view that's easy to submit all details in one form
 
Share this answer
 
Hi buddy


Quote:
There are many way to pass the value from one page to another.
You can pass value through Querystring or you can use Session for the same.
You only need to Manage as your logical need and after use Dispose all as Security Purpose.



Do some Google its Simple
Happy to help!!!
 
Share this answer
 
v2
Comments
Thanks7872 8-Oct-13 2:43am    
I think OP is not intended to use different pages. He wants something like tabs.
Shubh Agrahari 8-Oct-13 2:47am    
no where it sound like tabs..i read it again d'nt think so.....and if u have query then ask it
Thanks7872 8-Oct-13 3:05am    
Don't you see my comment below the question it self? How it will look if you have 7 pages for registration? Don't you have some sort of logic?
Shubh Agrahari 8-Oct-13 3:13am    
yes but how can we define it...there is some other condition also embed that increase the need of multiple pages beside of MultiView but yes always do sort as you can
Hey,

You can use session variables, hidden fields based upon your requirement.
Hidden fields can be pretty useful.
Have a look below:

C#
<input type="hidden" id="hiddenPersonalDetails" runat="server" />
<input type="hidden" id="hiddenEducationalDetails" runat="server" />
<asp:textbox id="txtName" runat="server" xmlns:asp="#unknown"></asp:textbox>
<asp:textbox id="txtEducation" runat="server" xmlns:asp="#unknown"></asp:textbox>


On Submit button click:

C#
protected void btnSubmit_Click(object sender, EventArgs e)
{
hiddenPersonalDetails.Value=txtName.Text;
hiddenEducationalDetails.Value=txtEducation.Text;
}


Below code might help you to insert the records in the DB

C#
string personalDetails=hiddenPersonalDetails.Value;
string educationalDetails=hiddenEducationalDetails.Value;

string connectionString = "Your connection string";
using (SqlConnection connection = new SqlConnection(connectionString))
using (SqlCommand command = connection.CreateCommand())
{
command.CommandText = "INSERT INTO dbo.table(PersonalDetails, EducationalDetails) VALUES (@personalDetails, @educationalDetails)";

command.Parameters.AddWithValue("@personalDetails", personalDetails);
command.Parameters.AddWithValue("@educationalDetails",educationalDetails);
            
connection.Open();
command.ExecuteNonQuery();
connection.Close();
}


Regards
Anurag
 
Share this answer
 

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