Accessing client side dynamic controls within ASP.NET codebehind

前端 未结 3 1503
Happy的楠姐
Happy的楠姐 2021-01-20 00:11

Hi I\'m trying to access the html controls that are created dynamically within an event but I\'m unable to access this.

I\'m using the following code to create the

3条回答
  •  慢半拍i
    慢半拍i (楼主)
    2021-01-20 00:26

    The reason why dynamic input controls only show up when there is at-least 1 static is because the form needs the enctype="multipart/form-data" to upload files and asp.net adds that when you have 1 static file control. To have no static file input controls, you can set the enctype="multipart/form-data" attribute for the form manually in the aspx markup or in code-behind: Page.Form.Attributes.Add("enctype", "multipart/form-data");

提交回复
热议问题