Click here to Skip to main content
15,909,051 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
How to disable panel in javascript that contain 2 link button(All and None).How to do that I tried like this but does not worked.Does anybody have any idea about this? document.getElementById("<%=mypanel.ClientID%>").disabled=true;All are asp.net server contol not html .

What I have tried:

document.getElementById("<%=mypanel.ClientID%>>").disabled=true;
Posted
Updated 5-May-16 20:57pm
Comments
Karthik_Mahalingam 5-May-16 5:53am    
extra end tag in what i have tried.
F-ES Sitecore 5-May-16 5:54am    
You can't "disable" visual elements like panels (which are rendered as divs), you'd have to disable the link buttons either by hiding them or overriding their "click" event. It would probably be best to simply have two versions of the panel, one for enabled and one for disabled then show\hide the relevant panel as needed.

 
Share this answer
 
What you exactly want to do;

To make panel non-responsive, such that it is visible to user but user can't able to click on any buttons. Normally, this is possible by enable/disable.

And if you want them to be make non available for users, then simple make it invisible.

Add this panel to separate div in html. And then simply, make this div "visible/invisible" or "enable/disable".

And if you want to disable panel directly, then go for;
To make disable;
var panel = document.getElementById('<%=PanelID.ClientID%>');
panel.enable=false


or
To make invisible
var panel = document.getElementById('&lt;%=PanelID.ClientID%&gt;');
panel.visible=false


For both cases, it is necessary to add

ClientIDMode="Static"


property to panel tag at html side.
 
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