以下是我片段程序:for(int j=0;j<tStrMenuItem.Length/4;j++)
{
for(int k=0;k<4;k++)
{
CheckBox cbox = new CheckBox();
cbox.ID = "t"+ j.ToString() + k.ToString()+"_1";
cbox.Text="";
cbox.Attributes.Add("onchange","savedate('"+Request["TravelID"].Trim()+"','"+tStrMenuItem[j,k].ToString()+"','"+Request["SetData"]+"');"); TABLE1.Rows[j].Cells[k].Controls.Clear();
TABLE1.Rows[j].Cells[k].Controls.Add(cbox); }
}
怎么前台生产的 onchange 事件 没有绑定到  input 里面呢,请高手帮忙了
前台产生的代码:<table id="TABLE1" height="150" cellspacing="0" cellpadding="0" width="708" border="0">
<tr>
<td><span onchange="savedate('0908030001','090821','1');" style="float:left;"><input id="t00_1" type="checkbox" name="t00_1" /></span><span><div style="float:left;"><a href='knowledge_place_info.aspx?GUID=64' target="_blank" >商店名稱</a></div><div style="clear: "></div></span><input name="Hih00_1" id="Hih00_1" type="hidden" value="090821" /></td>
<td><span onchange="savedate('0908030001','zssw','1');" style="float:left;"><input id="t01_1" type="checkbox" name="t01_1" /></span><span><div style="float:left;"><a href='knowledge_place_info.aspx?GUID=57' target="_blank" >zsss</a></div><div style="clear: "></div></span><input name="Hih01_1" id="Hih01_1" type="hidden" value="zssw" /></td>
<td><span><div style="float:left;"><a href='knowledge_place_info.aspx?GUID=' target="_blank" ></a></div><div style="clear: "></div></span><input name="Hih02_1" id="Hih02_1" type="hidden" /></td>
<td><span><div style="float:left;"><a href='knowledge_place_info.aspx?GUID=' target="_blank" ></a></div><div style="clear: "></div></span><input name="Hih03_1" id="Hih03_1" type="hidden" /></td>
</tr>
</table>

解决方案 »

  1.   

    你那样添加事件应该是不正确的方法或不标准和方法...应该是这样...
    cbox.onclick = Function(函数名());
    然后别外定义一下这个函数....
      

  2.   


    cbox.onclick 嘛?提示没有这样的事件,我也不知道这样是否正确,一般向服务器控件添加js 函数就是用 控件Id.Attributes.Add()
      

  3.   

    cbox.onclick = Function(savedate());
     function savedate()
    {alert('可以吗?');}