首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 网站开发 > asp.net >

.net页面上img标签点击事件,该怎么处理

2013-09-05 
.net页面上img标签点击事件页面上有个img标签,我用作确定按钮,然后我现在不知道点击事件怎么些。页面有3个

.net页面上img标签点击事件
页面上有个img标签,我用作确定按钮,然后我现在不知道点击事件怎么些。页面有3个文本框,可以改然后点击img保存修改到sql,我想问下img的点击事件我想用后台.cs写的方法。。我写了但是不能触发呢
<table width="200px" border="1">
            <tr>
                <td style="width: 100px">
                    姓名:
                </td>
                <td style="width: 100px">
                    <input type="text" runat="server" name="xm" id="xm"  style="width:100px"/>
                </td>
            </tr>
            <tr>
                <td style="width: 100px">
                    电话:
                </td>
                <td style="width: 100px">
                    <input type="text" runat="server" name="dh" id="dh"  style="width:100px"/>
                </td>
            </tr>
            <tr>
                <td style="width: 100px">
                    性别:
                </td>
                <td style="width: 100px">
                    <input type="text" runat="server" name="xb" id="xb"  style="width:100px"/>


                </td>
            </tr>
            <tr>
                <td style="width: 200px" colspan="2">
                    <img id="anniu" name="" src="新文件夹1/QQ图片20130801210318.jpg" width="32"  onclick="dianji()" height="32" alt=".net页面上img标签点击事件,该怎么处理" style="width:200px"/>
                </td>
            </tr>
        </table>

下面是.cs
 public bool dianji() 
    {
        ceshi1 c1 = new ceshi1();
        c1.Name = xm.Value;
        if (xb.Value.Equals("男"))
        {
            c1.Sex = 1;
        }
        else 
        {
            c1.Sex = 0;
        }
       
        c1.Tel = dh.Value;
        int res=ceshi1Service.getCount(c1);
        if (res > 1)
        {
            return true;
        }
        else 
        {
            return false;
        }
    }

求助在线等


[解决办法]
是的。只是我觉得没必要那么做,一个imagebutton就搞定了。

热点排行