我在aspx文件中用C#写了一段代码,如下:
<script language="C#">
private void creat()
{
ListBox list=new ListBox();
list.ID="list";
list.Items.Add("dfdf");
list.Items.Add("dercxh");
list.Width=174;
list.Attributes.Add("onchange","btnChange()");
ccc.Controls.Add(list);
}
</script>然后在定义td时,将它onclick事件定为creat,为什么会报错呀,提示为creat未定义
<TD class="clsDropDownCell" id="dropDownArrowCell" onclick="creat" bgColor="buttonface" runat="server"></td>
<script language="C#">
private void creat()
{
ListBox list=new ListBox();
list.ID="list";
list.Items.Add("dfdf");
list.Items.Add("dercxh");
list.Width=174;
list.Attributes.Add("onchange","btnChange()");
ccc.Controls.Add(list);
}
</script>然后在定义td时,将它onclick事件定为creat,为什么会报错呀,提示为creat未定义
<TD class="clsDropDownCell" id="dropDownArrowCell" onclick="creat" bgColor="buttonface" runat="server"></td>
解决方案 »
- 这个功能该如何去实现??关于图片和地图的
- asp.net两个项目的整合,IIS的配置,第二次提问,会的来,来者给分
- 使用了master页面后,如何链接入CSS文件?
- asp.net网站生成静态页面
- 有谁在苏州做asp.net的 ?
- 没有多少分了.求.net中的 播放器 RM MP3 WMA WVA格式的 .给代码下载可以不?
- 点"删除"按钮后,取不到DropDownList里的当前选中的值,怎么办?急~~~~
- 求国内信用卡接口和paypal的接口示例,大哥大姐帮帮我:
- 水晶报表在转换为PDF时,发生以下错误,谁能指点迷津?
- ASP.NET构建的思威在线CRM客户关系管理系统(源码提供)
- 旧话重提(一直未解决)
- 哪位能介绍几个比较好的关于.net方面的英文blog网站?
--->
protectedvoid creat()
publice void creat
private void InitializeComponent()
{
//在这里加上这句
this.dropDownArrowCell.Click += new System.EventHandler(this.creat);
}
改为 public
public void creat()
==
public void creat()
单元格有单击事件吗?没见过,可以考虑在里面放个button或label
?