⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 sixtwoone.aspx.cs

📁 做一些功能验证.比如非空验证.适合新手看
💻 CS
字号:
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 CheckBox9_CheckedChanged(object sender, EventArgs e)
    {

    }
    protected void Button1_Click(object sender, EventArgs e)
    {
      //联系信息
        string result="请选择你喜欢的编程语言:" ;
        if (this.RadioButton1.Checked == true)
            result += RadioButton1.Text;
        if (this.RadioButton2.Checked == true)
            result += RadioButton2.Text;
        if (this.RadioButton3.Checked == true)
        {
            Panel4.Visible = true;
            result += "<br>其他语言:"; 
            result += TextBox5.Text;     
        }
           
            result += "<br>所属区:";
            result += this.DropDownList1.SelectedValue;
            result += "<br>姓名:";
            result += TextBox1.Text;
            if (this.RadioButton4.Checked == true)
                result += RadioButton4.Checked;
            if (this.RadioButton5.Checked == true)
                result += RadioButton5.Checked;
     //帐户信息      
            result += "<br>用户名:";
            result += TextBox2.Text;
            if (this.TextBox3.Text != this.TextBox4.Text)
            {
                Response.Write("密码不一致!  请重新填写!");
                
                result = null;
            }
            else

     //兴趣爱好       
            result += "<br>兴趣爱好:";
            if (this.CheckBox1.Checked == true)
                result += CheckBox1.Text +" ";
            if (this.CheckBox2.Checked == true)
                result += CheckBox2.Text + " ";
            if (this.CheckBox3.Checked == true)
                result += CheckBox3.Text + " ";
            if (this.CheckBox4.Checked == true)
                result += CheckBox4.Text + " ";
            if (this.CheckBox5.Checked == true)
                result += CheckBox5.Text + " ";
            if (this.CheckBox6.Checked == true)
                result += CheckBox6.Text + " ";
            if (this.CheckBox7.Checked == true)
                result += CheckBox7.Text + " ";
            if (this.CheckBox8.Checked == true)
                result += CheckBox8.Text + " ";
            if (this.CheckBox9.Checked == true)
                result += CheckBox9.Text + " ";
            if (this.CheckBox10.Checked == true)
                result += CheckBox10.Text + " ";
            if (this.CheckBox11.Checked == true)
                result += CheckBox11.Text + " ";
  

        this.Label1.Text = result;
    }

    protected void RadioButton1_CheckedChanged(object sender, EventArgs e)
    {
        Panel4.Visible = false;
    }
    protected void RadioButton2_CheckedChanged(object sender, EventArgs e)
    {
        Panel4.Visible = false;
    }
    protected void RadioButton3_CheckedChanged(object sender, EventArgs e)
    {
        Panel4.Visible = true;
    }
    protected void CustomValidator1_ServerValidate(object source, ServerValidateEventArgs args)
    {
        if (args.Value.Length < 10 || args.Value.Length > 80)
        {
            args.IsValid = true;
        }
        else
            args.IsValid = false;
    }
}

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -