标题:求助 CSS 问题
只看楼主
hgwsywbj
Rank: 1
等 级:新手上路
帖 子:4
专家分:0
注 册:2012-8-30
结帖率:0
 问题点数:0 回复次数:0 
求助 CSS 问题
...

...







protected void CreateImage()
    {
        for (int m = 0; m < 3; m++)
        {
            ImageButton bt = new ImageButton();
            bt.CssClass = "img";
            bt.Width = 71;
            bt.Height = 96;
            bt.ImageUrl = "i/" + m.ToString() + ".jpg";
            bt.Click += new ImageClickEventHandler(bt_Click);
            Panel1.Controls.Add(bt);
        }
    }
    void bt_Click(object sender, ImageClickEventArgs e)
    {
        ImageButton bt = (ImageButton)sender;
        string ss = bt.ImageUrl;
        if (bt.CssClass == "imagebutton")
            bt.CssClass = "img";
        else
            bt.CssClass = "imagebutton";

    }
按钮数为1时运行正常,多个时无效。
搜索更多相关主题的帖子: void jpg 
2012-11-07 21:14



参与讨论请移步原网站贴子:https://bbs.bccn.net/thread-386345-1-1.html




关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.014893 second(s), 7 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved