向导控件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+"
";
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(
"");
InBlock.gif
ExpandedSubBlockEnd.gif    }

ExpandedBlockEnd.gif}

None.gif


点此下载代码

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

你可能感兴趣的:(向导控件Wizard的使用)