jscript document.getElementsByName в C # - PullRequest
0 голосов
/ 26 мая 2011

, что похоже на c #?

var e = document.getElementsByName("test")[0];
var HTML = e.innerHTML; 

Ответы [ 2 ]

2 голосов
/ 26 мая 2011

Рекурсивный метод FindControl:

    private Control RecursiveControlFind(Control parent, string controlID)
    {
        Control child = parent.FindControl(controlID);
        if (child == null)
        {
            if (parent.Controls.Count > 0)
            {
                foreach (Control nestedControl in parent.Controls)
                {
                    child = RecursiveControlFind(nestedControl, controlID);
                    if (child != null)
                        break;
                }
            }
        }
        return child;
    }
0 голосов
/ 26 мая 2011

Метод Control.FindControl , но не рекурсивный.

Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...