程序检测不到事件"enter_click:咋办?
错误描述:
'enter_click' is not a member of 'ASP.asp_net_chapter5_5_8_aspx'.
______________________________________
源:Line 34: <td><td><asp:button id="enter" text="提交" onclick="enter_click" runat="server"/>
________________________________________________
程序如下:<%@ import namespace="system.data"%>
<%@ import namespace="system.data.oledb"%>
<script language="vb" runa="server">
sub enter_click(sender as object,e as eventargs)
dim conn as new oledbconnection("provider=microsoft.jet.oledb.4.0;data source=" & server.mappath("../wwwlink"))
dim sql as string
sql="insert into wwwlink(sitename,url,intro,grade) values('"& sitename.text &"','"& url &"','"& intro.text &"','"& grade.text &"')"
dim cmd as new oledbcommand(sql,conn)
conn.open()
cmd.executenonquery()
conn.close()
end sub
</script>
<html>
<body>
<h3><font align="center">插入记录</font></h3>
<table align="center">
<form runat="server">
<tr>
<td>网站名称<td><asp:textbox id="sitename" runat="server"/>
<tr>
<td>网站地址<td><asp:textbox id="url" runat="server"/>
<tr>
<td>网站简介<td><asp:textbox id="intro" textmode="multiline" runat="server"/>
<tr>
<td>网站评分<td><asp:dropdownlist id="grade" runat="server">
<asp:listitem>1</asp:listitem>
<asp:listitem>2</asp:listitem>
<asp:listitem selected="true">3</asp:listitem>
<asp:listitem>4</asp:listitem>
<asp:listitem>5</asp:listitem>
</asp:dropdownlist>
<tr>
<td><td><asp:button id="enter" text="提交" onclick="enter_click" runat="server"/>
</form>
</table>
<a href="5-7.aspx">取消添加,返回首页</a>
</body>
</html>