Loop through all controls on asp.net webpage

后端 未结 7 1437
攒了一身酷
攒了一身酷 2020-12-01 22:17

I need to loop through all the controls in my asp.net webpage and do something to the control. In one instance I\'m making a giant string out of the page and emailing it to

7条回答
  •  夕颜
    夕颜 (楼主)
    2020-12-01 22:51

    Please find the below code. This should help you with all the controls you need. You should be able to use Web Page Controls, as well as ASP.NET Controls.

    public partial class Default : System.Web.UI.Page
    {
    
    List lstControl = new List();
    
    protected void Page_Load(object sender, EventArgs e)
    {
    
    }
    
    private List

提交回复
热议问题