向导控件Wizard的使用

      一般应用在分布填写个人资料时,比如注册。。。以后会用的到。

None.gif using  System;
None.gif
using  System.Data;
None.gif
using  System.Configuration;
None.gif
using  System.Web;
None.gif
using  System.Web.Security;
None.gif
using  System.Web.UI;
None.gif
using  System.Web.UI.WebControls;
None.gif
using  System.Web.UI.WebControls.WebParts;
None.gif
using  System.Web.UI.HtmlControls;
None.gif
None.gif
public  partial  class  _Default : System.Web.UI.Page 
ExpandedBlockStart.gifContractedBlock.gif
dot.gif {
InBlock.gif    
protected void Page_Load(object sender, EventArgs e)
ExpandedSubBlockStart.gifContractedSubBlock.gif    
dot.gif{
InBlock.gif
ExpandedSubBlockEnd.gif    }

InBlock.gif    
protected void Wizard1_ActiveStepChanged(object sender, EventArgs e)
ExpandedSubBlockStart.gifContractedSubBlock.gif    
dot.gif{//活动步骤更改时激发的事件
InBlock.gif

InBlock.gif
InBlock.gif        labname.Text 
= tbName.Text;//直接赋值
InBlock.gif
        labpwd.Text = tbPws.Text;
InBlock.gif
InBlock.gif        
if (RadioButtonList1.SelectedValue.ToString() == "不好")
ExpandedSubBlockStart.gifContractedSubBlock.gif        
dot.gif{//个人资料是否显示
InBlock.gif
            labsf.Text = "用户已设置了隐藏";
InBlock.gif            labdh.Visible 
= false;
ExpandedSubBlockEnd.gif        }

InBlock.gif        
else
ExpandedSubBlockStart.gifContractedSubBlock.gif        
dot.gif{
InBlock.gif            labsf.Text 
= ddlsf.SelectedValue.ToString();
InBlock.gif            labdh.Text 
= tbPhone.Text;
ExpandedSubBlockEnd.gif        }

InBlock.gif
InBlock.gif        CheckBoxList cbl 
= (CheckBoxList)mb.ContentTemplateContainer.FindControl("chk");//这步比较关键,由于我们设置的兴趣爱好为模板列,所以必须用这种方法去寻找模板列中的控件
InBlock.gif
        for (int i = 0; i < cbl.Items.Count; i++)
ExpandedSubBlockStart.gifContractedSubBlock.gif        
dot.gif{
InBlock.gif            
if (cbl.Items[i].Selected)
ExpandedSubBlockStart.gifContractedSubBlock.gif            
dot.gif{
InBlock.gif                Label lb 
= new Label();
InBlock.gif                lb.ID 
= "lab" + i;
InBlock.gif                lb.Text 
= cbl.Items[i].Text+"<br>";
InBlock.gif                ph.Controls.Add(lb);
ExpandedSubBlockEnd.gif            }

ExpandedSubBlockEnd.gif        }

InBlock.gif
ExpandedSubBlockEnd.gif    }

InBlock.gif    
protected void Wizard1_FinishButtonClick(object sender, WizardNavigationEventArgs e)
ExpandedSubBlockStart.gifContractedSubBlock.gif    
dot.gif{//当点击完成按钮时激发的事件
InBlock.gif        
//在这里,我们可以写入数据库插入语句,来完成用户的注册等功能
InBlock.gif

InBlock.gif        
string str = "尊敬的  " + labname.Text;
InBlock.gif        Response.Write(
"<script>alert('"+str+",感谢您的注册');</script>");
InBlock.gif
ExpandedSubBlockEnd.gif    }

ExpandedBlockEnd.gif}

None.gif


点此下载代码

转载于:https://www.cnblogs.com/mgod/archive/2007/03/31/695262.html

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值