aspx Page events execute twice after HTTP POST

L

Lewis

Hi,

Im having a problem with an aspx page that I'm building (and rather urgently
needing to complete!).

Situation is this...
Im transforming some XML using an XSLT which builds an HTML form using an
aspx (C# - using VS.NET). Within the resulting HTML is a form, which
contains the following :
<form method="POST" action="recieveForm.aspx?lang=eng">

That posts to the page 'recieveForm.aspx'.
'recieveForm.aspx' recieves the form and processes the data from the form
elements
and stores them in a database.

The issue I have is that the Page_Load event (which calls my subsequent data
store method) gets called twice, and after further testing it appears all
the page methods run twice.Which results in me having duplicate records
within my data table.

Having searched through a lot of articles in the newsgroups I can't seem to
find a resolution or a reason for this happening.

I am not implementing AutoEventWireUp and I do not have a Handles
declaration at the end of the Page_Load Method.
IsPostBack is false both times the method is executed.

What Im looking for is a solution and hopefully an explanation of why this
should happen - surely you can post an HTML form to an aspx page and recieve
the Headers as normal?

Would appreciate any help anyone can give.

LB
 
L

Lewis

DOH!

Im concentrating too much on my code rather than the HTML Output!

Ignaciao, as you rightly guessed I was using an image button and it also had
an onClick event! Thanks sooo much!

Lewis
 

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

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,014
Latest member
BiancaFix3

Latest Threads

Top