Click here to Skip to main content
16,016,425 members
Please Sign up or sign in to vote.
4.00/5 (1 vote)
See more:
I have two page page1 and page2 on page1 and page2 consist button with event in page1 the button event fire but after load page2 some time button event fire and some time not fire on page2.On page 2 i have used User control and that user control have button event and also use on user control MaskedEditExtender control. so i want to know in which case this type of problem occur.

My code:

C#
protected void btnGetToalHour_Click(object sender, EventArgs e)
        {
            TimeSheetDay TSD = new TimeSheetDay();
            if (TSD.BeginingOfTime.ToString() != string.Empty && TSD.EndOfTime.ToString() != string.Empty)
            {

                if ((TSD.BeginingOfTime.Hour >= 8 && TSD.BeginingOfTime.Hour <= 17) && (TSD.EndOfTime.Hour >= 8 && TSD.EndOfTime.Hour <= 17))
                {
                    //lblMessage.Visible = false;
                    decimal StartTime = Convert.ToDecimal(TSD.BeginingOfTime.Hour.ToString() + "." + TSD.BeginingOfTime.Minute.ToString());
                    decimal EndTime = Convert.ToDecimal(TSD.EndOfTime.Hour.ToString() + "." + TSD.EndOfTime.Minute.ToString());
                    txthour.Text = Convert.ToString(EndTime - StartTime);
                }
                else
                { lblMessage.Text = "Please check entered working  strat time and end Time"; lblMessage.Visible = true; }
            }
            else
            { lblMessage.Text = "Please entered working  strat time and end Time"; lblMessage.Visible = true; }
        }
Posted
Updated 15-Sep-11 5:02am
v3
Comments
raviprajapat 15-Sep-11 10:23am    
protected void btnGetToalHour_Click(object sender, EventArgs e)-----> i used here breakpoints to know event fire or not but debugger not reach here
raviprajapat 15-Sep-11 10:26am    
this event write on User control and that user control drag on page2

1 solution

MaskedEditExtender control have wrong validation that cause of event not fire
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900