Go Back   Velocity Reviews > Newsgroups > ASP Net
User Name
Password
Register FAQ Members List Calendar Search Today's Posts Mark Forums Read

Reply

ASP Net - button's click handler gets called twice

 
Thread Tools Search this Thread
Old 04-07-2004, 02:21 PM   #1
Default button's click handler gets called twice


Do you have "AutoEventWireup" in your page directive set to true? If so, remove it or set it to false.

Matt Hawley, MCAD .NET
http://www.eworldui.net

Hi all,
I have a strange problem. I have a button called btnSubmit on a .aspx
page. I have written btnSubmit_Click method in C# to handle the button's
click event. In the .aspx file, the onclick attribute is set as
onclick="btnSubmit_Click". This is the only place where I call the
btnSubmit_Click event handler. But when I run the application and click the
btnSubmit button, the btnSubmit_Click method get called twice.
Any idea?

Thanks...
-Nikhil





Matt Hawley
  Reply With Quote
Old 04-07-2004, 02:31 PM   #2
Nikhil Patel
 
Posts: n/a
Default button's click handler gets called twice
Hi all,
I have a strange problem. I have a button called btnSubmit on a .aspx
page. I have written btnSubmit_Click method in C# to handle the button's
click event. In the .aspx file, the onclick attribute is set as
onclick="btnSubmit_Click". This is the only place where I call the
btnSubmit_Click event handler. But when I run the application and click the
btnSubmit button, the btnSubmit_Click method get called twice.
Any idea?

Thanks...
-Nikhil




Nikhil Patel
  Reply With Quote
Old 04-07-2004, 02:35 PM   #3
Matt Hawley
 
Posts: n/a
Default Re: button's click handler gets called twice
Nikhil,

Hmm, You stated that you have the OnClick set in HTML...if you view your C#/VB.NET code, is there also another wireup somewhere?

Matt Hawley, MCAD .NET
http://www.eworldui.net

Hi Matt,
AutoEventWireup is already set to false. Is there anything else I can
try?

Thanks...

"Matt Hawley" <mhawley@n!o!s!p!a!m.integrityts.com> wrote in message
news:...
> Do you have "AutoEventWireup" in your page directive set to true? If so,

remove it or set it to false.
>
> Matt Hawley, MCAD .NET
> http://www.eworldui.net
>
> Hi all,
> I have a strange problem. I have a button called btnSubmit on a .aspx
> page. I have written btnSubmit_Click method in C# to handle the button's
> click event. In the .aspx file, the onclick attribute is set as
> onclick="btnSubmit_Click". This is the only place where I call the
> btnSubmit_Click event handler. But when I run the application and click

the
> btnSubmit button, the btnSubmit_Click method get called twice.
> Any idea?
>
> Thanks...
> -Nikhil
>
>
>






Matt Hawley
  Reply With Quote
Old 04-07-2004, 02:47 PM   #4
Nikhil Patel
 
Posts: n/a
Default Re: button's click handler gets called twice
Hi Matt,
AutoEventWireup is already set to false. Is there anything else I can
try?

Thanks...

"Matt Hawley" <mhawley@n!o!s!p!a!m.integrityts.com> wrote in message
news:...
> Do you have "AutoEventWireup" in your page directive set to true? If so,

remove it or set it to false.
>
> Matt Hawley, MCAD .NET
> http://www.eworldui.net
>
> Hi all,
> I have a strange problem. I have a button called btnSubmit on a .aspx
> page. I have written btnSubmit_Click method in C# to handle the button's
> click event. In the .aspx file, the onclick attribute is set as
> onclick="btnSubmit_Click". This is the only place where I call the
> btnSubmit_Click event handler. But when I run the application and click

the
> btnSubmit button, the btnSubmit_Click method get called twice.
> Any idea?
>
> Thanks...
> -Nikhil
>
>
>





Nikhil Patel
  Reply With Quote
Old 04-07-2004, 02:50 PM   #5
Matt Hawley
 
Posts: n/a
Default Re: button's click handler gets called twice
Awesome, glad I could help!

Matt Hawley, MCAD .NET
http://www.eworldui.net

Yes, I had another wireup in the code behind file. After I removed it, the
application worked fine.
Thanks...
-Nikhil

"Matt Hawley" <mhawley@n!o!s!p!a!m.integrityts.com> wrote in message
news:...
> Nikhil,
>
> Hmm, You stated that you have the OnClick set in HTML...if you view your

C#/VB.NET code, is there also another wireup somewhere?
>
> Matt Hawley, MCAD .NET
> http://www.eworldui.net
>
> Hi Matt,
> AutoEventWireup is already set to false. Is there anything else I can
> try?
>
> Thanks...
>
> "Matt Hawley" <mhawley@n!o!s!p!a!m.integrityts.com> wrote in message
> news:...
> > Do you have "AutoEventWireup" in your page directive set to true? If

so,
> remove it or set it to false.
> >
> > Matt Hawley, MCAD .NET
> > http://www.eworldui.net
> >
> > Hi all,
> > I have a strange problem. I have a button called btnSubmit on a .aspx
> > page. I have written btnSubmit_Click method in C# to handle the

button's
> > click event. In the .aspx file, the onclick attribute is set as
> > onclick="btnSubmit_Click". This is the only place where I call the
> > btnSubmit_Click event handler. But when I run the application and click

> the
> > btnSubmit button, the btnSubmit_Click method get called twice.
> > Any idea?
> >
> > Thanks...
> > -Nikhil
> >
> >
> >

>
>
>






Matt Hawley
  Reply With Quote
Old 04-07-2004, 03:01 PM   #6
Nikhil Patel
 
Posts: n/a
Default Re: button's click handler gets called twice
Yes, I had another wireup in the code behind file. After I removed it, the
application worked fine.
Thanks...
-Nikhil

"Matt Hawley" <mhawley@n!o!s!p!a!m.integrityts.com> wrote in message
news:...
> Nikhil,
>
> Hmm, You stated that you have the OnClick set in HTML...if you view your

C#/VB.NET code, is there also another wireup somewhere?
>
> Matt Hawley, MCAD .NET
> http://www.eworldui.net
>
> Hi Matt,
> AutoEventWireup is already set to false. Is there anything else I can
> try?
>
> Thanks...
>
> "Matt Hawley" <mhawley@n!o!s!p!a!m.integrityts.com> wrote in message
> news:...
> > Do you have "AutoEventWireup" in your page directive set to true? If

so,
> remove it or set it to false.
> >
> > Matt Hawley, MCAD .NET
> > http://www.eworldui.net
> >
> > Hi all,
> > I have a strange problem. I have a button called btnSubmit on a .aspx
> > page. I have written btnSubmit_Click method in C# to handle the

button's
> > click event. In the .aspx file, the onclick attribute is set as
> > onclick="btnSubmit_Click". This is the only place where I call the
> > btnSubmit_Click event handler. But when I run the application and click

> the
> > btnSubmit button, the btnSubmit_Click method get called twice.
> > Any idea?
> >
> > Thanks...
> > -Nikhil
> >
> >
> >

>
>
>





Nikhil Patel
  Reply With Quote
Reply


Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
How to activate Remote Assistance with XP using Windows Live Messenger Oziisr General Help Related Topics 0 02-01-2008 04:45 PM
How to make your wonderful photo and video slideshow on DVD kricww@gmail.com DVD Video 0 04-20-2006 07:26 AM
Converting PAL DVDs to NTSC DVDs. Wild Coyote DVD Video 14 10-27-2004 09:58 PM
winsock.dll J A+ Certification 7 07-20-2004 01:01 AM
Latest Tech Fiasco... Ghost A+ Certification 30 01-09-2004 12:15 PM




SEO by vBSEO 3.3.2 ©2009, Crawlability, Inc.

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46