以下是我片段程序: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>
{
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>
解决方案 »
- 百度地图API 这个例子,火狐里得到的和IE里得到的不一样,而且都不能用
- 登录事件,当用户密码出错时脚本执行了,会什么就不弹出提示对话框,不解!
- C#操作WORD 在原有WORD文档 追加文字
- ASP.NET 页面跳转取值问题
- 请问asp.net2.0中如何在内容页里面捕获母版页里的用户控件的事件?
- 类似Microsoft Visual Studio 工具箱的功能(急)
- 如何把App_Code文件名改为自定义的?
- *******************************请教一个关于href的问题************************
- asp.net 2.0 的TreeView如何设置展开,缩起时的图片不一样?
- ASP.net中如何实现后台全局参数传递?在线等待中。。。。。
- 我使用了母板页,其中的树目录是用<div>实现的,现在出现的问题是每次点击树目录后,都回获取当前目录,而这和我在数据库中存储的目录拼接后就会出现跳转错误
- 如何用asp.net编程与oracle数据库做个简单点的系统?
cbox.onclick = Function(函数名());
然后别外定义一下这个函数....
cbox.onclick 嘛?提示没有这样的事件,我也不知道这样是否正确,一般向服务器控件添加js 函数就是用 控件Id.Attributes.Add()
function savedate()
{alert('可以吗?');}