Function executed twice

Discussion in 'ASP .Net' started by Bruno Alexandre, Feb 14, 2007.

  1. Hi guys,

    from some time I have a problem in my ASPX pages (2.0)
    when I drag a LinkButton or Button or Whatever and then I go to server
    propreties and click twice on the event onClick

    the Visual Studio 2005 places ButtonName_Click inside the button tag and in
    the code behing file gives-me

    ButtonName_CLick( bla bla ) Handles ButtonName.Click

    if inside this event I just write something to the database (even a simple
    response.write("HEllO<hr/>")) and then I execute the page, and click in the
    link/button I get the page to write 2 times that phrase !!!

    if I delete the event from the button FINE
    if I delete the Handles ButtonName.Click FINE


    but by default VS2k5 add this two and I need to delete one everytime before
    saving the file, cause if I want to navigate from design to code in
    code-behid I usually click twice in the link/button and that will ADD the
    event onCLick in the tag and the Handles in the code behind...

    Does anyone cross with this error? what do I have to do do have only one
    single event even with both events on the TAG and the CODE-BEHIND ?

    my header page always starts with:
    <%@ Page Language="VB" AutoEventWireup="false" CodeFile="Default.aspx.vb"
    Inherits="_Default"
    LCID="1030" Strict="true" Explicit="true" %>

    any ideas?
    --

    Bruno Alexandre
    Stroby, Danmark

    "a Portuguese in Denmark"
    Bruno Alexandre, Feb 14, 2007
    #1
    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. Alberto

    Event executed twice

    Alberto, Jan 12, 2004, in forum: ASP .Net
    Replies:
    1
    Views:
    349
    Steve C. Orr [MVP, MCSD]
    Jan 12, 2004
  2. =?Utf-8?B?TWFnZXNo?=
    Replies:
    0
    Views:
    357
    =?Utf-8?B?TWFnZXNo?=
    Aug 25, 2004
  3. Alfons Puig
    Replies:
    0
    Views:
    328
    Alfons Puig
    Jan 5, 2005
  4. Replies:
    0
    Views:
    437
  5. DrKen
    Replies:
    8
    Views:
    1,793
    Denis McMahon
    Jun 24, 2011
Loading...

Share This Page