实现表情插入的问题

kres520 kres520 墨衍会员 · AI 创作全网分发 墨衍智能分发 通过墨衍一键同步至各平台 可同步平台 CSDN微信公众号微博知乎掘金百家号博客园抖音小红书 你的文章也可以这样分发 墨衍会员 ¥399起/年,写一次发全网 我也要 + 加入社区
问题是:
有80张图片作为表情,图片分别为1.gif~80.gif
目的是点下“显示图片”按钮,显示出表情图片的列表(这个列表我写在了一个PANEL中),并且每点击一个表情,在下面的TEXTBOX中显示出[表情代号],如点击1.gif则在textbox中显示[1]。
为了点击一个图片不刷新网页,所以将所有表情和“显示图片”按钮写在了UPDATEPANEL中。代码如下
<asp:UpdatePanel ID="UpdatePanel1" runat="server" >
<ContentTemplate>
<asp:ImageButton ID="Imgbtn" runat="server" ImageUrl="/image/显示图片.jpg" onclick="Show"/>
<asp:Panel ID="pData" runat="server" BackColor=Black>

<asp:ImageButton ID="ImageButton1" runat="server" ImageUrl="image/face/1.gif" OnClick="Face1"/>
<asp:ImageButton ID="ImageButton2" runat="server" ImageUrl="image/face/2.gif"/>
<asp:ImageButton ID="ImageButton3" runat="server" ImageUrl="image/face/3.gif"/>
<asp:ImageButton ID="ImageButton4" runat="server" ImageUrl="image/face/4.gif"/>
........
</asp:Panel>
</ContentTemplate>
</asp:UpdatePanel>
Face1的代码是
protected void Face1(object sender, EventArgs e)
{
TextBox2.Text = TextBox2.Text + "[1]";
}
但是我点击图片1的时候TEXTBOX2中没有任何变化,是否与UPDATEPANEL有关?
另外请达人帮忙简化代码。。。这样枚举实在太麻烦了,不胜感激
...全文
评论 10
收藏 已收藏
分享
返回顶部
kres520
.NET社区 62,272 成员 668,968 内容