0

ページ名を文字列として渡して asp.net ページにアクセスし、Controls コレクションでコントロールを見つけることができますか。そんな感じ :

    private void GetPageCtrl(string pageName)
    {
// Process pageName
.
.
.
//        

string allTextBoxValues = "";
        foreach (Control c in pageName.Controls)
        {
            foreach (Control childc in c.Controls)
            {
                if (childc is TextBox)
                {
                    allTextBoxValues += ((TextBox)childc).Text + ",";
                }
            }
        }
        if (allTextBoxValues != "")
        {
            Label1.Text = allTextBoxValues;
        }
    }

前もって感謝します。

4

0 に答える 0