Click here to Skip to main content
15,892,005 members
Please Sign up or sign in to vote.
1.00/5 (1 vote)
See more:
How we can use post function in asp.net page. i required this because if i posted the current form to another form then i need the previous form input data to this form.
please any one can help me.
Thanks in advance

I have use in the button click properties PostbackUrl set the next form name.
if i declare like this then the data of the first form can't save in the database.
Posted
Updated 3-Jun-11 21:59pm
v2

Are you referring about form POST method ?

<form id="Form1" action="YourNextPage.aspx" method="post"></form>


Set proper name property of every control in the current page. In the next page you can get all this values in the Request like below.


Request("controlname").ToString


Example link[^]

Hope it helps.

[Edit]
Reference-1[^]

Reference -2[^]
[/Edit]
 
Share this answer
 
v3
Comments
rahul dev123 4-Jun-11 7:00am    
I have already a form tag used in my master form so i can't used 2 forms tag in one form. so any other procedure to do that?
That's Aragon 4-Jun-11 7:49am    
Please review my edited solution with reference link.
hi,,


you can use sessions or query strings
 
Share this answer
 
Comments
rahul dev123 4-Jun-11 3:57am    
I can't use session because there is a lots of field in the first form, so i don't want to use session.
 
Share this answer
 
Use Server.Transefet instead of Response.redirect, so you can use previous page values.
Example :- using previous page value as

VB
Dim txt As TextBox

       ' Find the control name on the previous page
       txt = CType(Page.PreviousPage.FindControl _
           ("serverNameText"), TextBox)
       If Not IsNothing(txt) Then
           prevServerName.Text = Server.HtmlEncode(txt.Text)
       Else
           prevServerName.Text = "[Name Not available]"
       End If
 
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