473,387 Members | 1,700 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,387 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 15 '05 #1
1 5795
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 15 '05 #2

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

Similar topics

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: 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...
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...
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: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
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
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...

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.