Click here to Skip to main content
15,884,628 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
How to aceess panel ID in aspx.cs page using javascript

document.getElementById
Posted
Updated 10-Nov-19 5:31am
v2
Comments
P.Salini 8-Nov-11 5:28am    
Clarify your question
sravani.v 8-Nov-11 5:28am    
You can directly access Panel ID in .cs file

Why you want go for javascript?
yeshgowda 8-Nov-11 5:35am    
I have to pass Panel ID to .jss file through aspx.cs How to set panel ID using documnet.getElementByID()
In jss file iam setting style attribute
Sys.UI.DomElement.setLocation(element, point.x, point.y);
element.style.removeProperty('display');
element.style.visibility = value ? 'visible' : 'hidden';
This doesnot works if pass parameter panel.ClientID to javascript in aspx.cs page so how to send a parameter Panel ID using document.getelemetID

In aspx page if i pass parameter progressPanelId the style are set
var progressPanelId = document.getElementById('<%=_progressPanel.ClientID %>');

But i need to know in aspx.cs page how to send

If you are using master page then use this
JavaScript
document.getElementById('<%=pnlSearch.ClientID%>').style.display = 'none';
 
Share this answer
 
Comments
thatraja 8-Nov-11 5:42am    
Right, 5!
P.Salini 8-Nov-11 5:46am    
Thank you raja
Try this
JavaScript
document.getElementById('<%=pnlSearch%>').style.display = 'none';
 
Share this answer
 
Comments
P.Salini 8-Nov-11 5:40am    
My 5!
in aspx
<asp:panel id="disp_countrypanel" clientidmode="Static" runat="server">

in jquery

$("#disp_countrypanel").hide();
 
Share this answer
 
Comments
Dave Kreskowiak 10-Nov-19 11:45am    
Answered better, twice, 8 years ago.

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