![]() |
|
|
|||||||
![]() |
ASP Net - button's click handler gets called twice |
|
|
Thread Tools | Search this Thread |
|
|
#1 |
|
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 |
|
|
|
|
#2 |
|
Posts: n/a
|
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 |
|
|
|
#3 |
|
Posts: n/a
|
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 |
|
|
|
#4 |
|
Posts: n/a
|
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 |
|
|
|
#5 |
|
Posts: n/a
|
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 |
|
|
|
#6 |
|
Posts: n/a
|
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 |
|
![]() |
| Thread Tools | Search this Thread |
|
|
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 |