Re: Beginner question re postback

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance

From: Ian (ianinmalaga_at_hotmail.com)
Date: 06/24/04


Date: Thu, 24 Jun 2004 11:37:43 +0200

thanks joe,

great, any ideas which is the best route ?? you listed a few, are there any
pros and cons?

cheers

J
"Joe Fallon" <jfallon1@nospamtwcny.rr.com> wrote in message
news:ebkkM2XWEHA.2908@TK2MSFTNGP10.phx.gbl...
> In Page Load always test for IsPostback and Not IsPostback so that when
the
> page is hit the first time different code is run.
>
> If you click a button, then Page Load will run but maybe since IsPOstback
=
> True then you won;t do anything there.
> Then your button handler code will run and you can do stuff.
> The last line of code might be:
> Response.Redirect("SomeOtherPage.aspx")
>
> The variables will NOT be available on the next page unless you do
> something.
> Cache
> Session
> QueryString
> etc.
>
> e.g you could store them in Cache or Session during your button handler
code
> and then pull them out
> when you get to the next page.
>
> Or you could put them in a querystring:
> Response.Redirect("SomeOtherPage.aspx?MyVariable=xyz")
> --
> Joe Fallon
>
>
>
>
> "John W" <jwhoust@hotmail.com> wrote in message
> news:%23X3gkzWWEHA.208@TK2MSFTNGP10.phx.gbl...
> > Hello,
> >
> > I have been wondering that everytime I do a submit on a button/form
> > (postback) it is using the same webform on the CS, how do I goto another
> > webform once I have done a postback and processed any code?
> >
> > When I finally do goto another webform from the postback will all
> variables
> > and settings be sent along to this new web form?
> >
> > Thanks
> >
> > J
> >
> >
>
>


Quantcast