ζSAㄣ龍

软件设计业是一种艺术!

  博客园 :: 首页 :: 新随笔 :: 联系 :: 订阅 :: 管理 ::

页面内添加表情

 

添加表情
    <script language="javascript">
        
function TextBoxImg(t2t)
        
{          
           document.getElementById(
"TextBox1").innerText+="[IMG]"+t2t+"[/IMG]";
        }

        
</script>

添加心情图标
 1    #region 添加心情图标
 2        private void AddNewFace()
 3        {
 4            DirectoryInfo Root=new DirectoryInfo(Page.MapPath("NewFace"));
 5            string[] NewFaceImg=new string[Root.GetFiles("*.gif").Length];
 6            for(int i=0;i<NewFaceImg.Length;i++)
 7            {
 8                NewFaceImg[i]=i.ToString()+".gif";
 9                ImageButton ib=new ImageButton();
10                ib.ImageUrl="NewFace/"+NewFaceImg[i];
11                //this.ImageButton1.Click += new System.Web.UI.ImageClickEventHandler(this.ImageButton1_Click);
12                ib.Attributes.Add("OnClick","TextBoxImg('"+ib.ImageUrl+"',this); return false;");                
13                this.imgs.Controls.Add(ib);
14            }
15            
16        }
17        #endregion
18

1    <TR>
2                                <TD style="WIDTH: 71px; HEIGHT: 44px" vAlign="top" align="right">图标:</TD>
3                                <TD style="HEIGHT: 44px" vAlign="top"><asp:image id="Image1" runat="server" ImageUrl="Face/0.jpg"></asp:image><br>
4                                    <asp:dropdownlist id="DropDownList1" runat="server" CssClass="DropDownList" OnChange="document.images['Image1'].src='face/'+options[selectedIndex].value;"></asp:dropdownlist><FONT face="宋体"></FONT></TD>
5                            </TR>
posted on 2006-09-18 12:03  ζSAㄣ龍  阅读(254)  评论(0)    收藏  举报