日期:2014-05-18  浏览次数:20623 次

再webApplication中使用Html控件的问题
为什么在WebApplication中Html控件的事件不会触发。我只是单击按钮然后在文本框里显示“Ok”,用WebControl可以的,这是怎么回事?
如下: <%@   Page   Language= "C# "   %>
<script   runat= "server ">
protected   void   Click(object   sender,EventArgs   e)
{
          this.textBox.value= "OK "
}
</script>
<html>
<head> </head>
<body>
<form   id= "form1 "   runat= "server ">
<input   type= "button "   id= "btn1 "   onclick= "click "   runat= "server "/>
<input   type= "text "   id= "textBox "   runat= "sever ">
</form>
</body>
</html>

------解决方案--------------------
Html控件就是设计在客户端使用的,如果想与服务器进行交互就得使用服务器控件