I am facing issue with regards to the TreeView
control. I have checkbox enabled for nodes of TreeView
control. It is working fine and showing properly. But when I deploy same to IIS, checkbox is not visible there. It is not rendered at all.
Below is the TreeView
:
<asp:TreeView id="tvExplicit"
EnableClientScript="true"
PopulateNodesFromClient="true"
ExpandDepth="0"
ShowLines="true"
ShowExpandCollapse="true"
ShowCheckBoxes="Root"
OnTreeNodePopulate="tvExplicit_TreeNodePopulate"
Width="1px"
runat="server">
<Nodes>
</Nodes>
</asp:TreeView>
This code is working fine on my local machine. But not when deployed on IIS. Everything works except showing checkboxes for root nodes.
Note: Checkboxes are not rendered as HTML at all. So it is not CSS blocking it as per me
Update : I was able to figure out that previous version of the page is cached in IIS and not being reset even after APP pool was reset.
2nd Update: Client Id of checkboxes in localhost is ctl00_MainContent_tvExplicitn0CheckBox
, ctl00_MainContent_tvExplicitn1CheckBox
,etc. So can it be the reason of the issue.
One more thing that I noticed is the difference in client ID's generated for the controls in localhost and in server deployed to IIS.
Below is the rendered <a>
which is part of treeview control in both:
- IIS:
MainContent_tvExplicitt0
,MainContent_tvExplicitt1
this is ID of treeview node link - LocalHost:
ctl00_MainContent_tvExplicitt0
,ctl00_MainContent_tvExplicitt2
,etc
So can the issue be related to how controls are actually being rendered in different environments viz my localhost and IIS server.
In localhost, .Net 3.5 framework
is there and in IIS server .Net 4
. So can it be due to this as client ID
generation is different in both versions.
3rd Update
Also, I changed framework version to .net 4
in localhost
, but it didn't reproduce the issue.It also did add controlRenderingCompatibilityVersion="3.5"
in web.config. Then I deployed same code to IIS, and I got an error that controlRenderingCompatibilityVersion
is not a valid tag. Does it mean IIS
server is not running on .net 4
.I don't have access to IIS server myself.
4th Update:
Application is configured with .net 4
version in IIS.
5th Update I deployed same build to another IIS server on different machines(these were our old servers on which our application was running). And checkboxes are visible on that. Version of .net framework is same as that on the one facing issues. Asked the relevant team to update same settings as in these servers to servers on which are facing issue. Still it didnt help. So, it does seem to be issue with how website is configured on new servers where checkboxes are not visible