Disabling postback on TreeView nodes when expanding / collapsing

as?

I tried AutoPostback=false, but clicking on node still sends the page back. Any ideas?

+3
source share
4 answers

Farther...

The operation of automatic selection for each node is SelectExpand, the “Select” part of this enumeration is interpreted as “I have selected something and you need to send it back”. To simply “expand” a node without causing a postback:

TreeView1.Nodes (0) .SelectAction = TreeNodeSelectAction.Expand

+5
source

EnableClientScript , . , (Emphasis mine):

EnableClientScript, , TreeView script . true, . node , script . script , node .

:

  • node,
  • EnableClientScript false
  • ,
  • , , ( .NET 1.1 , - IE UserAgent "Downlevel", 128 )

, , PopulateOnDemand, PopulateNodesFromClient TreeNodePopulate .


, , , - , - , , PopulateNodesFromClient TreeNodePopulate, , ( , ).

jQuery Tree View, , ( , - TreeView, , "", ), :

  • jQuery framework,
  • -, , .
  • , JavaScript.

3 - , , JavaScript , , jQuery - , JavaScript, jQuery TreeView , , , , , ASP.NET TreeView, , JavaScript , (.. -) .

, jQuery - Microsoft ( ), , - MS "" ASP.NET, , , ( ), - , ASP.NET MVC, - IIS .NET, .

+2

TreeView asp.net ,

obth treeview:

.

0
source

add below code to css file. Then select the TreeView property called by NodeStyle-> Cssclass = disabled

a.disabled { pointer-events: none; cursor: default; }

0
source

Source: https://habr.com/ru/post/1706420/


All Articles