Passing form values from one page to other. Please, help me out. Thank You.

M

Miguel Dias Moura

Hello,

i created an ASP.net / VB page with a really big form.

Now i want to create 4 pages and in each one i will place 1/4 of the big
form.

The last page will send all the form values by email.

How can i send the form values from one page to the next one?

I looked everywhere and i wasn't able to make this work. I found a good
ASP.net / C code example in
http://www.dotnetbips.com/displayarticle.aspx?id=79. However, i am having
problems in translating it to VB.
Yes, i did used the most 2 common translaters but i am still having
problems.

Is there someone that can help me doing this? 2 sample ASP.net / VB pages
would be great.

Anyway, any help would be apreciated.

Thank You Very Much,
Miguel
 
L

Lerp

Hi Miguel,

Instead of using 4 different pages why don't you use one page and seperate
the form into 4 sections using panels on that one page...that way you
wouldn't have to pass the form values around. You can use the Visible
property of the panels to toggle the different sections to show/hide.

An idea anyways :)

Cheers, Lerp :)
 
S

Steve C. Orr [MVP, MCSD]

One way would be to keep your single page, and put each of the 4 sections
into its own panel. Then show & hide each panel one at a time in order,
simulating 4 separate pages. This way all your data is actually kept on a
single page from the server's perspective, making it unnecessary to come up
with a complex scheme to pass the data all over the place.
 
M

Miguel Dias Moura

Never did something like that.
Can anyone indicate me where can i find some information about it?

Thank You,
Miguel
 
L

Lerp

Hi there,

Here's an example started for you.
Basically you create your form all on one page like normal, the insert
panels every quarter of the way (in your case), each with its own unique ID
(name) and then create a sub routine to handle the visible property of the
panel in question. Then you create some buttons to 'spark' the event...your
sub handles the visbility of the panels.



'Sub to handle panel in question's visibility based on checking the Button's
(ie: the Sender in this case) Text Property - which you set when you make
your button (as seen below)(maybe use a Select case here instead of mi
IF/END IF statement since you
are testing the same variable over)

Sub ChangePanelVisibility(Sender As Object, E As EventArgs)

If Sender.Text = "Show Panel One" Then
myFirstPanel.visible = true ' SET TO TRUE HERE
mySecondPanel.visible = false
myThirdPanel.visible = false
myFourthPanel.visible = false
End If

End Sub



<form ID="myForm" runat="server">

<asp:panel ID="myFirstPanel" CssClass="myCssClass" runat="server">
First section of form
</asp:panel>

<asp:panel ID="mySecondPanel" CssClass="myCssClass" runat="server">
Second section of form
</asp:panel>

<asp:panel ID="myThirdPanel" CssClass="myCssClass" runat="server">
Third section of form
</asp:panel>

<asp:panel ID="myFourthPanel" CssClass="myCssClass" runat="server">
Fourth section of form
</asp:panel>



<asp:Button id="ShowPanelOneButton" text="Show Panel One"
OnClick="ChangePanelVisibility" runat="server" CssClass="but" />
<asp:Button id="ShowPaneltwoButton" text="Show Panel Two"
OnClick="ChangePanelVisibility" runat="server" CssClass="but" />
etc...one button for each panel if you wish here...
</form>



Hope this helps, Lerp :)
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top