我希望在单击添加按钮时可以动态的加载htmlinputfile控件 ,但是无论单击多少次,始终只会显示一个htmlinputfile,另外,如何以编程方式指定该控件的runat="server"属性。
多谢!
<%@ Page Language="VB" %>
<script runat="server">
sub button_click(sender as object,e as eventargs)
dim i as integer
i=i+1
dim myfile as new htmlinputfile
myfile.id="myfile" & i
placeholder1.controls.add(myfile)
placeholder1.controls.add(new literalcontrol("<br>"
)
end sub
</script>
<html>
<head>
</head>
<body>
<form runat="server">
<asp:button id="button" onclick="button_click" runat="server" text="添加" />
<asp
laceHolder id="PlaceHolder1" runat="server"></asp
laceHolder>
</form>
</body>
</html>