.net通过循环改变控件Visible属性

来源:百度知道 编辑:UC知道 时间:2024/06/30 15:53:48
页面有3个FileUpload1,FileUpload2,FileUpload3和一个Button1
FileUpload1的Visible属性为true;
FileUpload2的Visible属性为false;
FileUpload3的Visible属性为false;
当我点击Button1时,FileUpload2的Visible属性为true;
再点击一次Button1,FileUpload3的Visible属性为true;
请问这段循环代码应该怎么写呢?

<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default2.aspx.cs" Inherits="Default2" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<title>无标题页</title>
</head>
<body>
<form id="form1" runat="server">
<div>
<asp:Button ID="Button1" runat="server" Text="Button" OnClick="Button1_Click" /><br />
<asp:FileUpload ID="FileUpload1" runat=&qu