一般应用在分布填写个人资料时,比如注册。。。以后会用的到。
点此下载代码
using System;
using System.Data;
using System.Configuration;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
public partial class _Default : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
}
protected void Wizard1_ActiveStepChanged(object sender, EventArgs e)
{//活动步骤更改时激发的事件
labname.Text = tbName.Text;//直接赋值
labpwd.Text = tbPws.Text;
if (RadioButtonList1.SelectedValue.ToString() == "不好")
{//个人资料是否显示
labsf.Text = "用户已设置了隐藏";
labdh.Visible = false;
}
else
{
labsf.Text = ddlsf.SelectedValue.ToString();
labdh.Text = tbPhone.Text;
}
CheckBoxList cbl = (CheckBoxList)mb.ContentTemplateContainer.FindControl("chk");//这步比较关键,由于我们设置的兴趣爱好为模板列,所以必须用这种方法去寻找模板列中的控件
for (int i = 0; i < cbl.Items.Count; i++)
{
if (cbl.Items[i].Selected)
{
Label lb = new Label();
lb.ID = "lab" + i;
lb.Text = cbl.Items[i].Text+"<br>";
ph.Controls.Add(lb);
}
}
}
protected void Wizard1_FinishButtonClick(object sender, WizardNavigationEventArgs e)
{//当点击完成按钮时激发的事件
//在这里,我们可以写入数据库插入语句,来完成用户的注册等功能
string str = "尊敬的 " + labname.Text;
Response.Write("<script>alert('"+str+",感谢您的注册');</script>");
}
}
using System.Data;
using System.Configuration;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
public partial class _Default : System.Web.UI.Page
{
protected void Page_Load(object sender, EventArgs e)
{
}
protected void Wizard1_ActiveStepChanged(object sender, EventArgs e)
{//活动步骤更改时激发的事件
labname.Text = tbName.Text;//直接赋值
labpwd.Text = tbPws.Text;
if (RadioButtonList1.SelectedValue.ToString() == "不好")
{//个人资料是否显示
labsf.Text = "用户已设置了隐藏";
labdh.Visible = false;
}
else
{
labsf.Text = ddlsf.SelectedValue.ToString();
labdh.Text = tbPhone.Text;
}
CheckBoxList cbl = (CheckBoxList)mb.ContentTemplateContainer.FindControl("chk");//这步比较关键,由于我们设置的兴趣爱好为模板列,所以必须用这种方法去寻找模板列中的控件
for (int i = 0; i < cbl.Items.Count; i++)
{
if (cbl.Items[i].Selected)
{
Label lb = new Label();
lb.ID = "lab" + i;
lb.Text = cbl.Items[i].Text+"<br>";
ph.Controls.Add(lb);
}
}
}
protected void Wizard1_FinishButtonClick(object sender, WizardNavigationEventArgs e)
{//当点击完成按钮时激发的事件
//在这里,我们可以写入数据库插入语句,来完成用户的注册等功能
string str = "尊敬的 " + labname.Text;
Response.Write("<script>alert('"+str+",感谢您的注册');</script>");
}
}
点此下载代码