button click event not firing

button click event not firing

Page 1 of 1

3 Replies - 18323 Views - Last Post: 27 April 2011 - 09:00 PM Rate Topic: -----

#1 rajasreepradeep  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 14
  • Joined: 23-June 08

button click event not firing

Posted 23 July 2008 - 03:41 AM

Hi,

I have to call a button click event from another button click event .
but it is not firing

Please help.


protected void btnReview_Click(object sender, EventArgs e)
		{
			if (MandatoryValidation())
			{
				
				this.Button1.Click += new System.EventHandler(this.Button1_Click);									   

			}
		}

		
		protected void Button1_Click(object sender, EventArgs e)
		{

		}



Is This A Good Question/Topic? 0
  • +

Replies To: button click event not firing

#2 PsychoCoder  Icon User is offline

  • Google.Sucks.Init(true);
  • member icon

Reputation: 1641
  • View blog
  • Posts: 19,853
  • Joined: 26-July 07

Re: button click event not firing

Posted 23 July 2008 - 06:22 AM

All you're doing is creating an event in that button click, you're not calling the other button's click event. Try this


if (MandatoryValidation())
{
        Button1_Click(null, null);
}


Was This Post Helpful? 0
  • +
  • -

#3 rajasreepradeep  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 14
  • Joined: 23-June 08

Re: button click event not firing

Posted 23 July 2008 - 09:56 PM

View PostPsychoCoder, on 23 Jul, 2008 - 06:22 AM, said:

All you're doing is creating an event in that button click, you're not calling the other button's click event. Try this


if (MandatoryValidation())
{
        Button1_Click(null, null);
}




This was helpful , Thanks ,
The Button1 has a attribute OnClientClick.

The click event of Button1 is executed but OnClientClick is not triggering , any idea what can be the reason.?

Will OnClientClick trigger when we do the click event of button manually..? or is it something not possible.?

Please help..
Was This Post Helpful? 0
  • +
  • -

#4 memoisme  Icon User is offline

  • New D.I.C Head

Reputation: 0
  • View blog
  • Posts: 18
  • Joined: 27-April 11

Re: button click event not firing

Posted 27 April 2011 - 09:00 PM

Will OnClientClick trigger when we do the click event of button manually?
yes OnClientClick trigger when we do the click event of button manually.
clientclick functionality is defined in html page where u can't insert breakpoint.i think it will work but handler is not htting..so i wud suggest just take a alert inside the
<script>
funtion onClientClickfuntionName()
{
alert(hello i am client click)
}
</script>

Was This Post Helpful? 0
  • +
  • -

Page 1 of 1