473,396 Members | 2,013 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

aspx Page events execute twice after HTTP POST

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

Nov 17 '05 #1
1 2598
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
"Ignacio Machin" <ignacio.machin AT dot.state.fl.us> wrote in message
news:On**************@tk2msftngp13.phx.gbl...
Hi Lewis,

I would like to see some code to bemore precise, how do you post the form? for what you see it seems that the browser send two request to the page,
maybe you are calling submit twice, maybe the submit is a image button (
that by default make a submit ) and in the onclick you are calling a
function that call also form.submit therefore two submit are send to the
server
anyway I think that you should look at the code generated in the client.

Hope this help,

--
Ignacio Machin,
ignacio.machin AT dot.state.fl.us
Florida Department Of Transportation

"Lewis" <Lewis_at_arc_dot_com> wrote in message
news:3f*********************@news.dial.pipex.com.. .
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


Nov 17 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Lewis | last post by:
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...
0
by: zoltix | last post by:
Hi, I am beginner in aspx. I would like to intercept all click events on my document. I use this function in javascipt for that document.onmousedown=click;. It works well. But I would...
1
by: Jarek | last post by:
Hi! I have a page containing datagrid. When datagrid is edited there is a calendar. When I change the date for the first time all page events are executed twice and: when they are executed for...
5
by: Arpan | last post by:
I am working on Win 2K Pro & use IIS 5.0 as the local server. I have installed Microsoft .NET Framework 1.1 to create ASPX web pages (using VB.NET) but when I am trying to execute an ASPX code, the...
6
by: Kentamanos | last post by:
Please don't ask me why I'm doing this (trust me, it makes sense in my system), but I'd like to basically redirect requests for a certain extension (thus a handler) to an ASPX page behind the scenes....
5
by: jonhyland | last post by:
Hey all, I'm writing a .NET application where I want all HTTP errors such as 404 to redirect back to the home page. Since .NET only handles HTTP errors if the client is requesting a .NET...
5
by: Peter Rilling | last post by:
I have an interesting issues that, although I not blocking me, is not very performance. Maybe someone can suggest a better way of doing this. 1) I have a page that displays a grid with command...
8
by: TS | last post by:
Hi, i have inherited a page from another user. The page is the target frame in a frameset. for some reason the whole page runs twice (page_load, init, etc. all run twice) I can't figure out how...
0
by: Carl Gilbert | last post by:
Hi I have recently got the ASP.NET 2.0 Clubsite Starter Kit up and running on my 1&1 web space. Recently I have started getting lots of exceptions and white pages. I have put some code in...
3
by: Joey | last post by:
I have several asp.net 2.0 apps written in VS2005 in C#. For each one, I like to create and track page view events, increment counters, etc. I do this in a block on each page, like this... ...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.