我有一个使用 CodeFile 的 asp 项目,但是当我将其更改为 CodeBehind 时,在 aspx 文件中无法识别 vb 函数,从而在 aspx 文件中给出“名称...未声明”错误。
为了使用 CodeBehind,除了在第一行更改codefile
为之外,还有其他事情要做吗?codebehind
以下代码在 aspx 文件中收到错误“未声明名称 'connex'”。
<%@ Page Language="vb" AutoEventWireup="false" Codebehind="browse.aspx.vb" Inherits="_browse" %> <!DOCTYPE html
PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head runat="server"> <title>Test</title> </head>
<body>
<form id="form1" runat="server">
<div>
<%
Dim s As String = connex()
Response.Write(s)
%>
</div>
</form>
</body>
</html>
===================
Imports System
Imports System.Web
Partial Public Class _browse
Inherits System.Web.UI.Page
Function connex() As String
Return "OK"
End Function
End Class