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

Popular posts from this blog

objective c - Change font of selected text in UITextView -

php - Accessing POST data in Facebook cavas app -

c# - Getting control value when switching a view as part of a multiview -