扫一扫
分享文章到微信
扫一扫
关注官方公众号
至顶头条
作者:飞刀 来源:aspcn 2007年10月26日
关键字: Windows
<Script Language="C#" Runat="Server"> public void Page_Load(Object src,EventArgs e) { if(!Page.IsPostBack) { file://初始化Panel State["PanelSeed"] = 0; Panel0.Visible = true; Panel1.Visible = false; Panel2.Visible = false; Panel3.Visible = false; } } public void PrevStep(Object src,EventArgs e) { file://大家没有忘记State吧。 string CurrentPanel = "Panel"+State["PanelSeed"].ToString(); State["PanelSeed"] = (int)State["PanelSeed"]-1; string PrevPanel = "Panel"+State["PanelSeed"].ToString(); file://这里注意FindControl的用法 Panel p = (Panel)FindControl(CurrentPanel); p.Visible = false; p = (Panel)FindControl(PrevPanel); p.Visible = true; } public void NextStep(Object src,EventArgs e) { string CurrentPanel = "Panel"+State["PanelSeed"].ToString(); State["PanelSeed"] = (int)State["PanelSeed"]+1; string NextPanel = "Panel"+State["PanelSeed"].ToString(); Panel p = (Panel)FindControl(CurrentPanel); p.Visible = false; p = (Panel)FindControl(NextPanel); p.Visible = true; if((int)State["PanelSeed"]==2) { FUserName.Text = UserName.Text; FPasswd.Text = Passwd.Text; FAddress.Text = Address.Text; FZipCode.Text = ZipCode.Text; FComment.Text = Comment.Text; } } </script> <html> <head> <title></title> </head> <body> <form runat="server"> <asp:Panel id="Panel0" runat="server" > <table border="1" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="41%"> <tr> <td width="100%" colspan="3" bgcolor="#339966" align="center"> <font color="#FFFF99">第一步 选择用户名</font></td> </tr> <tr> <td width="33%" bgcolor="#EEEDDB">用户名:</td> <td width="33%" bgcolor="#EEEDDB"> <asp:TextBox id="UserName" runat="Server" /></td> <td width="34%" bgcolor="#EEEDDB"> <asp:Button id="FristNextStep" Text="下一步" runat="server" OnClick="NextStep"/></td> </tr> </table> </asp:Panel> <asp:Panel id="Panel1" runat="server"> <table border="1" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="41%" height="32"> <tr> <td width="100%" colspan="2" bgcolor="#339966" align="center" height="15"> <font color="#FFFF99">第二步 填写用户信息</font></td> </tr> <tr> <td width="33%" bgcolor="#EEEDDB" height="16">用户名:</td> <td width="67%" bgcolor="#EEEDDB" height="16"> <%=UserName.Text%> </td> </tr> <tr> <td width="33%" bgcolor="#EEEDDB" height="16">密码:</td> <td width="67%" bgcolor="#EEEDDB" height="16"> <asp:TextBox TextMode="Password" id="Passwd" runat="server" /> </td> </tr> <tr> <td width="33%" bgcolor="#EEEDDB" height="16">确认密码:</td> <td width="67%" bgcolor="#EEEDDB" height="16"> <asp:TextBox TextMode="Password" id="RePasswd" runat="server" /> </td> </tr> <tr> <td width="33%" bgcolor="#EEEDDB" height="16">地址:</td> <td width="67%" bgcolor="#EEEDDB" height="16"> <asp:TextBox id="Address" runat="server" /> </td> </tr> <tr> <td width="33%" bgcolor="#EEEDDB" height="16">邮政编码:</td> <td width="67%" bgcolor="#EEEDDB" height="16"><asp:TextBox id="ZipCode" runat="server" /> </td> </tr> <tr> <td width="33%" bgcolor="#EEEDDB" height="16">简介:</td> <td width="67%" bgcolor="#EEEDDB" height="16"> <asp:TextBox id="Comment" TextMode="MultiLine" Wrap="True" Rows="10" runat="Server" /> </td> </tr> <tr> <td width="33%" bgcolor="#EEEDDB" height="16"> </td> <td width="67%" bgcolor="#EEEDDB" height="16"> <asp:Button id="FristPrevStep" Text="上一步" OnClick="PrevStep" runat="server"/> <asp:Button id="SecondNextStep" Text="下一步" OnClick="NextStep" runat="server" /> </td> </tr> </table> </asp:Panel> <asp:Panel id="Panel2" runat="server"> <table border="1" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="41%" height="32"> <tr> <td width="100%" colspan="2" bgcolor="#339966" align="center" height="15"> <font color="#FFFF99">第三步 确认用户信息</font></td> </tr> <tr> <td width="33%" bgcolor="#EEEDDB" height="16">用户名:</td> <td width="67%" bgcolor="#EEEDDB" height="16"> <asp:Label id="FUserName" runat="Server" /> </td> </tr> <tr> <td width="33%" bgcolor="#EEEDDB" height="16">密码:</td> <td width="67%" bgcolor="#EEEDDB" height="16"> <asp:Label id="FPasswd" runat="Server" /> </td> </tr> <tr> <td width="33%" bgcolor="#EEEDDB" height="16">地址:</td> <td width="67%" bgcolor="#EEEDDB" height="16"> <asp:Label id="FAddress" runat="Server" /> </td> </tr> <tr> <td width="33%" bgcolor="#EEEDDB" height="16">邮政编码:</td> <td width="67%" bgcolor="#EEEDDB" height="16"> <asp:Label id="FZipCode" runat="Server" /> </td> </tr> <tr> <td width="33%" bgcolor="#EEEDDB" height="16">简介:</td> <td width="67%" bgcolor="#EEEDDB" height="16"> <asp:Label id="FComment" runat="Server" /> </td> </tr> <tr> <td width="33%" bgcolor="#EEEDDB" height="16"> </td> <td width="67%" bgcolor="#EEEDDB" height="16"> <asp:Button id="SecondPrevStep" Text="上一步" OnClick="PrevStep" runat="server" /> <asp:Button id="FinishStep" Text="完成" OnClick="NextStep" runat="server" /> </td> </tr> </table> </asp:Panel> <asp:Panel id="Panel3" runat="server"> <table border="1" cellpadding="0" cellspacing="0" style="border-collapse: collapse" bordercolor="#111111" width="41%"> <tr> <td width="100%" colspan="3" bgcolor="#339966" align="center"> <font color="#FFFF99">恭喜您,您已经完成了所有的操作</font> </td> </tr> <tr> <td colspan="3" bgcolor="#EEEDDB">请您.......</td> </tr> </table> </asp:Panel> </form> </body> </html> |
如果您非常迫切的想了解IT领域最新产品与技术信息,那么订阅至顶网技术邮件将是您的最佳途径之一。
现场直击|2021世界人工智能大会
直击5G创新地带,就在2021MWC上海
5G已至 转型当时——服务提供商如何把握转型的绝佳时机
寻找自己的Flag
华为开发者大会2020(Cloud)- 科技行者