Click here to Skip to main content
15,942,964 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,

I have an application for booking rooms. inthat i have to enter userdetails in one page.when i click on submit it wil redirct to summary page ther one submit button is there.so actual submission takes place in summary page only.how i wil get all the user details from the previous page.Now iam using sessions for each and every control.is there any other way i can get the values.Also i have an edit button in summary page.when i click on edit bo\utton it should go to the user details page with all the data in that.But currently iam getting only the fresh page without any data.How to retain the data entered earlier?
Posted
Updated 1-Dec-12 20:25pm
v2
Comments
[no name] 2-Dec-12 2:34am    
Try to clear the session and while redirecting to other page, again use Session :)

You can use hidden html input elements or alternatively you can SUBMIT the contents of the first page to the second page and when you you load the second page store the variables in hidden input controls on that page and process it all in one go on the fnal page.

See the sample below....

Page 1 (default.aspx)
PAGE 1
======
<form id="form1" action="page2.aspx" method="post">
 Name<br /><input id="txtName" name="txtName" value ="Bob" /><br />
 <br /><br />
 <input type="submit" id="btnSubmit" value="Submit" />
</form>


And the second page (page2.aspx)

PAGE 2
======
<form id="form1" runat="server">
 Name<br /><input id="txtName" name="txtName" value ="<%=Request("txtName")%>" %>
 
 Telephone<br /><input id="txtPhone" name="txtPhone" value ="" />
 <br /><br /><br />
 <input type="submit" id="btnSubmit" value="Submit" />
</form>



Try it out by changing the name and submitting it.
 
Share this answer
 
why dont u try this

C#
response.redirect("ABC.aspx"?id=100);


and rerive this data on redirected page

C#
if (Request.QueryString["id"] != null) //Lets retrieve, increase and store again
{
    string id = Request.QueryString["id"];
}



and read more here

A Beginner's Tutorial on ASP.NET State Management[^]
 
Share this answer
 
I think you should use tab control for this scenario.
Two tab
1. User Details it contains nex button which open summary tab
2. Summary Actual submit button

Now on submit click you can get values from both tab
Look this links you will get idea
http://www.asp.net/ajaxlibrary/AjaxControlToolkitSampleSite/tabs/tabs.aspx
A Simple ASP.NET Tab Control Using the MultiView control

No need to use session here. If data stored in session is larger it will affect performance. In this case you dont need to store data.
 
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