lakki
lakki

Reputation: 125

How can I combine two onclient click for javascripts in c#?

I need to do two functions when I click the button .The code I written is

           lnkBtn_mail.OnClientClick = imgBtn_mail.OnClientClick = "javascript:NewEmailMessageWindow(" + invoice.Id + ", " + FindPage.ToString().ToLower() + ");return false;";        
           lnkBtn_mail.OnClientClick = imgBtn_mail.OnClientClick = "return DisableButtons(true);"; 

The problem is always below one is executing.SO How can I call these actions at a time?

Upvotes: 0

Views: 42

Answers (1)

rene
rene

Reputation: 42414

You can combine them in one onclientclick:

imgBtn_mail.OnClientClick = 
    String.Format(
      "javascript:DisableButtons(true); NewEmailMessageWindow({0}, {1});return false;",
      invoice.Id, 
      FindPage.ToString().ToLower()
      );        

Upvotes: 1

Related Questions