• 博客园logo
  • 会员
  • 众包
  • 新闻
  • 博问
  • 闪存
  • 赞助商
  • HarmonyOS
  • Chat2DB
    • 搜索
      所有博客
    • 搜索
      当前博客
  • 写随笔 我的博客 短消息 简洁模式
    用户头像
    我的博客 我的园子 账号设置 会员中心 简洁模式 ... 退出登录
    注册 登录
我的学习笔记
   首页       联系   管理    订阅  订阅

复选列--chenkboxlist

更改选定索引后激发
 protected void CheckBoxList1_SelectedIndexChanged(object sender, EventArgs e)
    
{
        
int n = cbl1.Items.Count;
        
for (int i = 0; i < n; i++)
        
{
            
if (cbl1.Items[i].Selected)
            
{
                
string txt = cbl1.Items[i].Text;
                
string t = txt.Replace(" 请投我一票", "<br>");
                Response.Write(t);
            }

        }

    }


数据绑定时激发
protected void CheckBoxList1_DataBound(object sender, EventArgs e)
    
{
        
int n = cbl1.Items.Count;

        
for (int i = 0; i < n; i++)
        
{
            
//cbl1.Items[i].Text = cbl1.Items[i].Text + "  请投我一票";
            cbl1.Items[i].Text += "  请投我一票";
        }

    }


设置调整属性
protected void Button2_Click(object sender, EventArgs e)
    
{
        
if (cbl1.RepeatDirection == RepeatDirection.Horizontal)
        
{
            Button2.Text 
= "给我水平配列";
            cbl1.RepeatDirection 
= RepeatDirection.Vertical;
        }

        
else
        
{
            Button2.Text 
= "给我垂直排列";
            cbl1.RepeatDirection 
=RepeatDirection.Horizontal;
        }

    }
posted @ 2007-12-17 17:21  吴有鋆  阅读(199)  评论(0)    收藏  举报
刷新页面返回顶部
博客园  ©  2004-2025
浙公网安备 33010602011771号 浙ICP备2021040463号-3