Re: How do I get a form to post to another page when runat="server



SO true... in the page_load event you should use the If logic as follows

If Not IsPostback then
load page for the first time
else
validate process
SERVER.TRANSFER("page2.aspx")
end if



"Marina" wrote:

> But if the validation is happening on the server, that means the page has
> already posted back to itself. So the Action was pointing to the current
> page.
>
> I dont' really understand what you are trying to do here.
>
> I would recommend you throw out 95% of the techniques you used to get things
> done in ASP. They will typically only lead you down the wrong path.
>
> Your page should validate its own data, and process it. Once it is done, it
> should redirect to the next logical page in your application. This page
> should follow the same model. Every page is typically self contained - it
> does not need the help of any other page to do its processing.
>
> Hope that helps.
>
> "COHENMARVIN" <cohenmarvin@xxxxxxxxxxx> wrote in message
> news:1122562801.604178.195140@xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
> > I'm a asp programmer starting out with asp.net. I understand that an
> > asp form can post to its own page and that this allows validation of
> > form fields on the server. But suppose all the controls turn out to be
> > valid, and now I want to move to a new page?
> > My form declaration looks like this:
> > <form METHOD="POST" ACTION="sites2.aspx" name="MyForm" runat="server">
> > This form declaration is on a page called sites1.aspx, but it doesn't
> > post any data to sites2.aspx. In fact, "sites2.aspx" doesn't show up
> > at all, instead I keep getting sites1.aspx every time I click on the
> > SUBMIT button.
> > What am I doing wrong?
> > Thanks,
> > CohenMarvin
> >
>
>
>
.