But now in above code I want to add just one if statement.. that if node.Count()!=0 then only render above script else one line statement in <p></p> tag is to be shown... so now code looks like as below. But this is giving razor rendering error when no child nodes are present... what is the problem..?
razor nodes.count() problem
hello..
I have following code in razor which works fine....
But now in above code I want to add just one if statement.. that if node.Count()!=0 then only render above script else one line statement in <p></p> tag is to be shown... so now code looks like as below. But this is giving razor rendering error when no child nodes are present... what is the problem..?
Maybe because in the loop of more than 0 youre checking if it even exists?
maybe try doing this above the check how many children it has?
is working on a reply...