Wrox Programmer Forums
Go Back   Wrox Programmer Forums > ASP.NET and ASP > ASP.NET 2.0 > ASP.NET 2.0 Basics
|
ASP.NET 2.0 Basics If you are new to ASP or ASP.NET programming with version 2.0, this is the forum to begin asking questions. Please also see the Visual Web Developer 2005 forum.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the ASP.NET 2.0 Basics section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old May 12th, 2006, 08:09 AM
Authorized User
 
Join Date: Apr 2006
Posts: 13
Thanks: 0
Thanked 0 Times in 0 Posts
Default Server Button Control event execute twice

Hi,

I am new to ASP .NET, I am using visual studio 2005 and ASP .NET 2.0.When I do a simple practical i find a strange problem on server button control.

I have a web form with a few text boxes and a submit button. When I click the submit button, the data in the text box will insert into database. but when I click the button I found that the same record is inserted twice. That means a single click on the button cause the button event execute twice.

Any idea? Thanks in advance.

Best Regards.

 
Old May 12th, 2006, 12:44 PM
Friend of Wrox
 
Join Date: Nov 2003
Posts: 1,348
Thanks: 0
Thanked 5 Times in 5 Posts
Default

post the button click code

 
Old May 19th, 2006, 03:25 PM
Registered User
 
Join Date: May 2006
Posts: 1
Thanks: 0
Thanked 0 Times in 0 Posts
Default

If you are using a code-behind page, be sure that your event is not being wired to code in your apsx page. Set AutoEventWireup="false" and be sure that the <asp:button/> tag does not have the attribute OnClick="yourButtonName_Click".

Good Luck!






Similar Threads
Thread Thread Starter Forum Replies Last Post
enter key should execute button click event MunishBhatia ASP.NET 2.0 Professional 6 November 25th, 2007 10:59 PM
Redirect inside a Server Control Button Andrew_S ASP.NET 2.0 Basics 1 April 19th, 2006 01:43 PM
Duplicate Control Creation on button click event kapi.goel C# 1 December 21st, 2005 02:42 PM
server control event in modal dialog diyagp General .NET 0 August 26th, 2004 02:57 AM
OnChange Event Doesn't Execute JLJones13 Javascript How-To 1 August 22nd, 2003 02:15 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.