473,796 Members | 2,520 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Problem With Page_Load

A.M
Hi,

Why the Page_Load events always triggers twice?

Thanks,
Ali


Nov 18 '05 #1
6 1002
Make sure AutoEventWireup ="false"
"A.M" <IH*******@sapm 123.com> wrote in message
news:Oa******** ******@tk2msftn gp13.phx.gbl...
Hi,

Why the Page_Load events always triggers twice?

Thanks,
Ali

Nov 18 '05 #2
Did you not read the response you got from "Felix[MSFT]" yesterday, or do
you not understand it, because you posted the question again in that thread,
and then post here now.
Nov 18 '05 #3
A.M
I can not see that post!
I tried to post is 3 times, I couldn't see it.
Then I removed those page codes, then here is the thread!! My outlook
express is fine because i can see other people's posts!!

I don't know whats going on!

"Michael Ramey" <raterus@localh ost> wrote in message
news:Op******** ******@TK2MSFTN GP12.phx.gbl...
Did you not read the response you got from "Felix[MSFT]" yesterday, or do
you not understand it, because you posted the question again in that thread, and then post here now.

Nov 18 '05 #4
You wouldn't happen to be using a browser interface to view these
newsgroups, would you? Certain kinds of code can mess with the browser, as
it is rendered as HTML in the browser document.

--
HTH,
Kevin Spencer
..Net Developer
Microsoft MVP
Big things are made up
of lots of little things.

"A.M" <IH*******@sapm 123.com> wrote in message
news:#K******** ******@TK2MSFTN GP11.phx.gbl...
I can not see that post!
I tried to post is 3 times, I couldn't see it.
Then I removed those page codes, then here is the thread!! My outlook
express is fine because i can see other people's posts!!

I don't know whats going on!

"Michael Ramey" <raterus@localh ost> wrote in message
news:Op******** ******@TK2MSFTN GP12.phx.gbl...
Did you not read the response you got from "Felix[MSFT]" yesterday, or do you not understand it, because you posted the question again in that

thread,
and then post here now.


Nov 18 '05 #5
Hi Ali,
Thank you for posting here. I find this post is a duplicated one with
another twos in the queue:
Subject: Page_Load

This is the third one you posted. Also, another MS support FelixWu[MSFT]
has replied you in the first one, I'm not sure whether you are able to see
the reply correctly? If not here is the reply's weblink in google:

http://groups.google.com/groups?hl=e...readm=nsDtQix6
DHA.3496%40cpms ftngxa07.phx.gb l&rnum=36&pre v=/groups%3Fq%3DPa ge_Load%26hl%3D
en%26lr%3D%26ie %3DUTF-8%26oe%3DUTF-8%26start%3D30% 26sa%3DN
Also, here is the original content of FelixWu[MSFT]'s reply, you may check
it if you event unable to visit its weblink in google:

----------------------------reply
content--------------------------------------------
From: fe*****@online. microsoft.com (Felix Wu [MSFT])
Date: Wed, 04 Feb 2004 12:15:12 GMT
Subject: RE: Page_Load
Newsgroups: microsoft.publi c.dotnet.framew ork.aspnet

Hi A.M,

You do not need to explicitly register the event handler Page_Load to the
Load event because it is registered by default:

<%@ Page %>
<HTML>
<HEAD>
<title>test</title>
<script language="vb" runat="server">
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As
System.EventArg s)
If Not Me.IsPostback Then
Response.Write( "ABC" + "<br>" )
end if
End Sub
</script>
</HTML>

Actually, this behavior is controlled by the AutoEventWireup attribute in @
Page directive. This attribute indicates whether the page's events are
autowired. "true" if event autowiring is enabled; otherwise, false. The
default is true. If you disable it, "ABC" only is displayed once:

<%@ Page AutoEventWireup =False%>
<HTML>
<HEAD>
<title>test</title>
<script language="vb" runat="server">
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As
System.EventArg s) Handles MyBase.Load

If Not Me.IsPostback Then
Response.Write( "ABC" + "<br>" )
end if
End Sub
</script>
</HTML>

Regards,

Felix Wu
----------------------------------------------------------------------------
If you have any other questions or need any assistance, please feel free to
post here.

Regards,

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)
Nov 18 '05 #6
A.M
Thank you Steven. I found my answers here.
As I mentioned I couldn't see my previous two posts. Sorry about that.
"Steven Cheng[MSFT]" <v-******@online.m icrosoft.com> wrote in message
news:9r******** ******@cpmsftng xa07.phx.gbl...
Hi Ali,
Thank you for posting here. I find this post is a duplicated one with
another twos in the queue:
Subject: Page_Load

This is the third one you posted. Also, another MS support FelixWu[MSFT]
has replied you in the first one, I'm not sure whether you are able to see
the reply correctly? If not here is the reply's weblink in google:

http://groups.google.com/groups?hl=e...readm=nsDtQix6 DHA.3496%40cpms ftngxa07.phx.gb l&rnum=36&pre v=/groups%3Fq%3DPa ge_Load%26hl%3D en%26lr%3D%26ie %3DUTF-8%26oe%3DUTF-8%26start%3D30% 26sa%3DN
Also, here is the original content of FelixWu[MSFT]'s reply, you may check
it if you event unable to visit its weblink in google:

----------------------------reply
content--------------------------------------------
From: fe*****@online. microsoft.com (Felix Wu [MSFT])
Date: Wed, 04 Feb 2004 12:15:12 GMT
Subject: RE: Page_Load
Newsgroups: microsoft.publi c.dotnet.framew ork.aspnet

Hi A.M,

You do not need to explicitly register the event handler Page_Load to the
Load event because it is registered by default:

<%@ Page %>
<HTML>
<HEAD>
<title>test</title>
<script language="vb" runat="server">
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As
System.EventArg s)
If Not Me.IsPostback Then
Response.Write( "ABC" + "<br>" )
end if
End Sub
</script>
</HTML>

Actually, this behavior is controlled by the AutoEventWireup attribute in @ Page directive. This attribute indicates whether the page's events are
autowired. "true" if event autowiring is enabled; otherwise, false. The
default is true. If you disable it, "ABC" only is displayed once:

<%@ Page AutoEventWireup =False%>
<HTML>
<HEAD>
<title>test</title>
<script language="vb" runat="server">
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As
System.EventArg s) Handles MyBase.Load

If Not Me.IsPostback Then
Response.Write( "ABC" + "<br>" )
end if
End Sub
</script>
</HTML>

Regards,

Felix Wu
-------------------------------------------------------------------------- --

If you have any other questions or need any assistance, please feel free to post here.

Regards,

Steven Cheng
Microsoft Online Support

Get Secure! www.microsoft.com/security
(This posting is provided "AS IS", with no warranties, and confers no
rights.)

Nov 18 '05 #7

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

Similar topics

3
1536
by: Michael Johnson Jr. | last post by:
The problem is the following pseudo code causes you need to click buttons twice to get event. This is notable via debugging and single stepping. I can't seem to quite figure out how to do events in ASP where they need to rerender the page. I been banging my head on this for 4 days now.
0
3530
by: Paul Rees | last post by:
I am wondering if anyone has encountered a similar problem to the one that I am having. I have an ASP.NET page which has a table and a dropdownlist that was added at design time. The majority of the rows in the table are then generated at run-time based on a SQL query from a Jet database, and similarly the dropdownlist is filled at run-time Then I follow these steps 1. Loop through the records returned by the OleDbDataReade 2. Setup a...
7
2240
by: Peter D.C. | last post by:
Hi I want to update data hold in several textbox controls on an asp.net form. But it seems like it is the old textbox values that is "re-updates" through a stored procedure who updates a SQL tabel. I know the SP works, because a smalldatetime-field in the database is changed. I've tried to disable viewstate on all textbox controls. Any ideas to solve this problem.
4
1315
by: Kenneth P | last post by:
Hi, I have a .aspx file named testConnStr.aspx witin a try, catch, finally block that works just very nice, shows the data in a datagrid. I have one header saying "test ConnStr" and two server objects, a label and a datagrid. So I decided to do it with code behind. What happens?
1
1260
by: needin4mation | last post by:
Hi, I am uploading a file and changing a record in a database. When the database is updated, I retrieve the last_insert_id() to get the latest row key. I also have a Page_Load event that populates controls on the form. The Page_Load gets the information from the database, including the field that has the latest key from my database (say product id). The problem is that my upload event is slower than the Page_Load event
7
1961
by: Martijn Saly | last post by:
Hi there, I've created a master page with some controls on it, a Calendar control among others. Now depending on the date(s) selected, the content page needs to be updated. In the masterpage I've created StartDate and EndDate properties, which are basically wrappers around the SelectedDates property from the Calendar control. When I select another date in the Calendar, the page updates normally, but when Page_Load for the content page...
2
2200
by: COHENMARVIN | last post by:
I have a form with a Submit button. The user fills out the form, clicks the submit button, and then the page posts back to itself. Every time the page posts back to itself, the "Page_Load" event fires. So if the user first types the URL of the page in the browser, the "Page_Load" event fires. Then he hits submit, and the form contents are posted back, so the "Page_Load" event fires again. The form appears again (I clear its contents),...
2
4558
by: Mike Collins | last post by:
I cannot get the correct drop down list value from a drop down I have on my web form. I get the initial value that was loaded in the list. It was asked by someone else what the autopostback was set to...it is set to false. Can someone show me what I am doing wrong and tell me the correct way? Thank you. In the page load event, I am doing the following:
2
2146
by: Ranginald | last post by:
Hi, I have two pages. Default.aspx ....Codefile="default.aspx.cs" Inherits="Web" %> and Sculpture.aspx
9
2729
by: rn5a | last post by:
A Form has a DataGrid which displays records from a SQL Server 2005 DB table. Users can modify the records using this DataGrid for which I am using EditCommandColumn in the DataGrid. This is the code: <script runat="server"> Dim sqlConn As New SqlConnection(".....") Sub Page_Load(ByVal obj As Object, ByVal ea As EventArgs) If Not (Page.IsPostBack) Then FillDataGrid()
0
9683
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10457
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, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
10231
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
10176
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
10013
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7550
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
5443
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5576
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
2
3733
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.