c# - How to tell the difference between an HtmlGenericControl that is a DIV and one that is a UL? -
i have code below:
foreach (control c in mycontrol.controls) { if(c.gettype().equals(typeof(htmlgenericcontrol))) { //do } }
my problem both ul , div tags considered htmlgenericcontrol. there condition add, divs enter if statement?
check tagname property:
foreach (control c in mycontrol.controls) { if(c.gettype().equals(typeof(htmlgenericcontrol)) && string.equals((htmlgenericcontrol)c).tagname, "div", stringcomparison.ordinalignorecase) { //do } }
Comments
Post a Comment