Forums » .NET » ASP.NET »

Button click event not fire at first time i click


Posted Date: 27 Aug 2009      Posted By:: Dhaval     Member Level: Bronze    Member Rank: 6192     Points: 1   Responses: 2




I have a web form that uses a Save button (see below) to save data. When I open the page and enter data and click on the Save button the page refreshes (as in a post back) but it doesn't save the changes. I don't get any error messages either. If I click it a second time it saves the data. I've tried all methods of debugging I can think of, but I can't find the problem. The click event doesn't appear to fire the first time, but it does fire the second time. Any idea what the problem is?

<asp:linkbutton id="SaveButton" text="Save" OnClick="SaveButton_Click" runat="server"/>




Responses

#417144    Author: Abhay Kumar Raut      Member Level: Gold      Member Rank: 41     Date: 27/Aug/2009   Rating: 2 out of 52 out of 5     Points: 2

Hi dhaval,

It is very difficult to figure out what's the issue by guessing .It is returning false on first click.Do one thing change it to asp button and check..

DNS MVM
Team Lead at MavStack Solutions
Bhubaneswar,Odisha
Thanks and Regards,
Abhay Kumar Raut


 
#417151    Author: Praveen      Member Level: Bronze      Member Rank: 5669     Date: 27/Aug/2009   Rating: 2 out of 52 out of 5     Points: 2

hi,

Check the Page Tag

AutoEventWireup="true"

the above might set to false change to true

it should look like


<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default9.aspx.cs" Inherits="Default9" %>


hope that will give you an idea


 
Post Reply

 This thread is locked for new responses. Please post your comments and questions as a separate thread.
If required, refer to the URL of this page in your new post.



Next : Crystal report issue
Previous : Speedometer chart in asp.net
Return to Discussion Forum
Post New Message
Category: ASP.NET

Related Messages

Subscribe to Subscribers
Awards & Gifts
Talk to Webmaster Tony John
Copyright © SpiderWorks Technologies Pvt Ltd., Kochi, India