B
Bodza Bodza
I have added several classes to an ASP.net project via the PROJECT>ADD
CLASS menu.
When I try to use them in the main page it fails with a type not found
error.
What gives? Can't you access code in classes which you have added to
the project?
Here's the code:
<%@ Page Language="vb" AutoEventWireup="false"
Codebehind="TranslatorSearchScreen.aspx.vb"
Inherits="TranslatorSearch.WebForm1" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"><html>
<head>
<title>Translator Search Screen</title>
</head>
<body MS_POSITIONING="GridLayout">
<h1> Translator Search Screen </h1>
<%
dim strAction as string
strAction = request.form("Action")
select case strAction
case "Search"
dim x as clsZ
end select
%>
<form id="Form1" method="post" runat="server">
<input type = "submit" value = "Search" id=btnSearchname =
"Action">
</form>
</body>
</html>
-----------------------
Public Class MainPage
Inherits System.Web.UI.Page
#Region " Web Form Designer Generated Code "
#End Region
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
'Put user code to initialize the page here
End Sub
End Class
Public Class clsZ
End Class
CLASS menu.
When I try to use them in the main page it fails with a type not found
error.
What gives? Can't you access code in classes which you have added to
the project?
Here's the code:
<%@ Page Language="vb" AutoEventWireup="false"
Codebehind="TranslatorSearchScreen.aspx.vb"
Inherits="TranslatorSearch.WebForm1" %>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"><html>
<head>
<title>Translator Search Screen</title>
</head>
<body MS_POSITIONING="GridLayout">
<h1> Translator Search Screen </h1>
<%
dim strAction as string
strAction = request.form("Action")
select case strAction
case "Search"
dim x as clsZ
end select
%>
<form id="Form1" method="post" runat="server">
<input type = "submit" value = "Search" id=btnSearchname =
"Action">
</form>
</body>
</html>
-----------------------
Public Class MainPage
Inherits System.Web.UI.Page
#Region " Web Form Designer Generated Code "
#End Region
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As
System.EventArgs) Handles MyBase.Load
'Put user code to initialize the page here
End Sub
End Class
Public Class clsZ
End Class