zoukankan      html  css  js  c++  java
  • 32CheckBox布局,字体替换--[Asp.Net]

            using System;
            using System.Collections.Generic;
            using System.Linq;
            using System.Web;
            using System.Web.UI;
            using System.Web.UI.WebControls;
            
            //包含demo
            namespace demo5
            {
                public partial class baohan2 : System.Web.UI.Page
                {
                    protected void CheckBoxList1_DataBound(object sender, EventArgs e)
                    {
                        int n = CheckBoxList1.Items.Count;
                        for (int i = 0; i < n; i++)
                        {
                            CheckBoxList1.Items[i].Text = CheckBoxList1.Items[i].Text;
                        }
                    
                    }
            
                    protected void CheckBoxList1_SelectedIndexChanged(object sender, EventArgs e)
                    {
                        int n = CheckBoxList1.Items.Count;
                        for (int i = 0; i < n; i++)
                        {
                            if(CheckBoxList1.Items[i].Selected )
                            {
                                string txt=  CheckBoxList1.Items[i].Text;
                                string t = txt.Replace ("你好","谢谢");
                                Response.Write(t);
            
                            }
                        }
                    }
            
                    protected void Button1_Click(object sender, EventArgs e)
                    {
                        //如果当前排列是垂直排列
                        if (CheckBoxList1.RepeatDirection == RepeatDirection.Vertical)
                        {
                            Button1.Text = "垂直排列";
                            CheckBoxList1.RepeatDirection = RepeatDirection.Horizontal;
                        }
                        else
                        {
                            Button1.Text = "给我水平排列";
                            CheckBoxList1.RepeatDirection = RepeatDirection.Vertical;
                        }
                    }
                    
                }
            }

    感受:

      这个可以用于评教里面,排列可以横排,可以竖排,选项,选中之后会有反应。

  • 相关阅读:
    数据泵导出 备份文件以日期时间命名
    执行计划的查看
    truncate 函数用法示例
    几个小知识点
    删除大表数据
    转 oracle 11g 导出空表
    数值转为财务大写
    oracle 取随机数据
    大表 update 方式
    >hibernate.cfg.xml的一些常用配置
  • 原文地址:https://www.cnblogs.com/wangmei/p/4491151.html
Copyright © 2011-2022 走看看