一下代码运行为什么显示如下错误:
Control 'DDL' of type 'DropDownList' must be placed inside a form tag with runat=server.<%@ Page Language="VB" ContentType="text/html" ResponseEncoding="gb2312" %>
<%@ Import Namespace="System.Data" %>
<script language="VB" runat="server">Sub Page_Load(sender As Object, e As EventArgs) Dim arr As ArrayList=new ArrayList()
arr.Add("英格兰")
arr.Add("意大利")
arr.Add("瑞典")
arr.Add("法国")
DDL.DataSource=arr
DDL.DataBind()
End Sub
</script>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title></title>
</head>
<body>
<asp:DropDownList ID="DDL" runat="server" />
</body>
</html>
Control 'DDL' of type 'DropDownList' must be placed inside a form tag with runat=server.<%@ Page Language="VB" ContentType="text/html" ResponseEncoding="gb2312" %>
<%@ Import Namespace="System.Data" %>
<script language="VB" runat="server">Sub Page_Load(sender As Object, e As EventArgs) Dim arr As ArrayList=new ArrayList()
arr.Add("英格兰")
arr.Add("意大利")
arr.Add("瑞典")
arr.Add("法国")
DDL.DataSource=arr
DDL.DataBind()
End Sub
</script>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title></title>
</head>
<body>
<asp:DropDownList ID="DDL" runat="server" />
</body>
</html>
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货