Wrox Home  
Search P2P Archive for: Go

  Return to Index  

aspx_professional thread: Re: Webforms and multiple pages


Message #1 by ankurs@s... on Mon, 4 Jun 2001 14:13:44
Hi,

This may be a possible solution to your problem. Instaed of having 3 
pages, code all of them in one .aspx page. YOu can assign each sections 
html a panel id and make it conditionally visible. 

To make it more clear, 

For your display part of .aspx page,

1) divide each of the three sections into three panels, each having a 
unique Id (asp.net supports this). Only one panel is visible at a 
time.When the post button is clicked, the code behind the page is checked.

For the code behind

1) On receiving the posted contents of teh form, check which of your 3 
conditions is true. Set the visibility of the other 2 panel Id's as false

This avoids a response.redirect to other pages.

You can find an example on making panel id's invisible at asp101.com and 4 
guysfromrolla.com

Hope this helps,

Ankur





> I'm having a problem producing a multi outcome site with webforms.  For
> example:
> 
> User fills out a form on a page (1).  If they fill out the form 
incorrectly
> they are returned to page 1 with a message prompting them to correct the
> error. If they fill out the form correctly they are sent to a results 
page
> (2).  If they are not yet logged in they are sent to page 3.  My problem 
is
> this:  How do I send them to the correct page without knowing which aspx
> page to send them to?
> 
> This seems to be the same problem that asp had - one set of code to one 
set
> of HTML.  I'd like to know how best to get around this without using a
> client-side redirect via HTTP (an unnecessary hit for the user).

  Return to Index