Click here to Skip to main content
15,868,306 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
In master page i have 5 buttons and contenPlaceHoder have 3 buttons

When i click contenPlaceHoder button then contenPlaceHoder all button enable false

as follow java Script Function

JavaScript
  function disable(control) {
    var btnGenerateInvoice =  document.getElementById('<%=btnGenerateInvoice.ClientID%>');

    btnGenerateInvoice.disabled = "false";
}



but master page button not disabled
Posted
Updated 30-Mar-15 20:26pm
v2

1 solution

Hi,

your problem is solved here

http://www.w3schools.com/jsref/prop_pushbutton_disabled.asp[^]

remember :- "false" and false both are different things. 1st one is string type and 2nd one is Boolean type.
 
Share this answer
 
v2
Comments
Pradeep_More 31-Mar-15 4:25am    
I have try this
but i want master page button on .aspx page by using java script.
Santosh K. Tripathi 31-Mar-15 4:33am    
in your code you are setting it "false". Look

btnGenerateInvoice.disabled = "false";



it should be true like this

btnGenerateInvoice.disabled = true;
Pradeep_More 31-Mar-15 4:50am    
This is fine this is working when btnGenerateInvoice present on aspx page but when btnGenerateInvoice present on master page then aspx file
var btn = document.getElementById('<%=btnGenerateInvoice.ClientID%>');

in java script give message "btnGenerateInvoice doesn't exist current context"
Santosh K. Tripathi 31-Mar-15 6:23am    
use F12. in Elements tab search for btnGenerateInvoice and see what is its client side id. i hope it will be like XYZ_btnGenerateInvoice .

now modify
var btn = document.getElementById('<%=btnGenerateInvoice.ClientID%>');

to
var btn = document.getElementById('XYZ_btnGenerateInvoice');

and see what happens.

if you could find btnGenerateInvoice in element tab it means this element is not rendered client side. so you can not manipulate this element.

try and see what is happening there?

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