Problem With Page_Load

Discussion in 'ASP .Net' started by A.M, Feb 4, 2004.

  1. A.M

    A.M Guest

    Hi,

    Why the Page_Load events always triggers twice?

    Thanks,
    Ali
     
    A.M, Feb 4, 2004
    #1
    1. Advertising

  2. A.M

    Janaka Guest

    Make sure AutoEventWireup="false"
    "A.M" <> wrote in message
    news:...
    > Hi,
    >
    > Why the Page_Load events always triggers twice?
    >
    > Thanks,
    > Ali
    >
    >
    >
    >
     
    Janaka, Feb 4, 2004
    #2
    1. Advertising

  3. 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.
     
    Michael Ramey, Feb 4, 2004
    #3
  4. A.M

    A.M Guest

    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@localhost> wrote in message
    news:...
    > 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.
    >
    >
     
    A.M, Feb 4, 2004
    #4
  5. 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" <> wrote in message
    news:#...
    > 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@localhost> wrote in message
    > news:...
    > > 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.
    > >
    > >

    >
    >
     
    Kevin Spencer, Feb 4, 2004
    #5
  6. 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=en&lr=&ie=UTF-8&oe=UTF-8&threadm=nsDtQix6
    DHA.3496%40cpmsftngxa07.phx.gbl&rnum=36&prev=/groups%3Fq%3DPage_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: (Felix Wu [MSFT])
    Date: Wed, 04 Feb 2004 12:15:12 GMT
    Subject: RE: Page_Load
    Newsgroups: microsoft.public.dotnet.framework.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.EventArgs)
    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.EventArgs) 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.)
     
    Steven Cheng[MSFT], Feb 5, 2004
    #6
  7. A.M

    A.M Guest

    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]" <> wrote in message
    news:...
    > 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=en&lr=&ie=UTF-8&oe=UTF-8&threadm=nsDtQix6
    >

    DHA.3496%40cpmsftngxa07.phx.gbl&rnum=36&prev=/groups%3Fq%3DPage_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: (Felix Wu [MSFT])
    > Date: Wed, 04 Feb 2004 12:15:12 GMT
    > Subject: RE: Page_Load
    > Newsgroups: microsoft.public.dotnet.framework.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.EventArgs)
    > 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.EventArgs) 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.)
    >
    >
     
    A.M, Feb 5, 2004
    #7
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Jay Balapa
    Replies:
    1
    Views:
    397
    Karl Seguin
    Jul 29, 2003
  2. tony collier

    problem putting enum in page_load

    tony collier, Jan 21, 2004, in forum: ASP .Net
    Replies:
    1
    Views:
    366
    Teemu Keiski
    Jan 22, 2004
  3. bminder
    Replies:
    1
    Views:
    2,178
    nfedin
    Feb 23, 2004
  4. z. f.
    Replies:
    0
    Views:
    563
    z. f.
    Oct 19, 2004
  5. rockdale
    Replies:
    1
    Views:
    661
    =?Utf-8?B?UGV0ZXIgQnJvbWJlcmcgW0MjIE1WUF0=?=
    Nov 16, 2006
Loading...

Share This Page