Answered by:
problems working with mixed languages website project (c# and vb)

Question
-
User-1886353747 posted
I am working with mixed code project. I am working with c# and vb in same visual studio project.
But when i tried to compile the vb ,
i get this error:
Parser Error
Description: An error occurred during the parsing of a resource required to service this request. Please review the following specific parse error details and modify your source file appropriately.
Parser Error Message: Could not load type '_success'.
Source Error:
Line 1: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
Line 2: <%@ Page Language="VB" AutoEventWireup="true" CodeBehind="success.aspx.vb" Inherits="_success" Title="Transporte Santiago :: Thanks!!" %>
Line 3: <html xmlns="http://www.w3.org/1999/xhtml">
Line 4: <head>
Source File: /success.aspx Line: 2
I know that this error is saying that cant load the _sucess class , but how to fix this? The c# pages works fine. i have problems only with VB code pages.Friday, June 24, 2011 3:54 AM
Answers
-
User-578657687 posted
This error occured is not due to mix C# and VB in a Web site.
Parser Error Message: Could not load type '_success'.
I think you need to comfirm if the class name in the .aspx.vb file is the same as value of Inherits in .aspx file.
"Could not load type '_success'", your
Partial Class _success Inherits System.Web.UI.Page
code behind should be like this:
- Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
Tuesday, June 28, 2011 4:50 AM
All replies
-
User-269404413 posted
Maria,
are you using any thrid party tool, assembly or uder control or master page with the name of success then check it is not there in the system referred place.
this is not an problem because of combination C# and VB
Friday, June 24, 2011 5:15 AM -
User369957501 posted
You can have C# and VB.NET aspx pages in a web application but you can't have C# and VB.NET class files together in App_code. If you still want to have two different code file in App_Code folder then make two folder with the name VB and CS and write the below code in the Web.Config file:
<compilation debug="false"> <codeSubDirectories> <add directoryName="VB"/> <add directoryName="CS"/> </codeSubDirectories> </compilation>
Hope this will help
Friday, June 24, 2011 5:22 AM -
User-1886353747 posted
i alredy created this two folders, and add these lines to the web config but same problems when compiling. :(
Friday, June 24, 2011 11:39 AM -
User-1886353747 posted
it do it but dont fix the problem.
Friday, June 24, 2011 7:31 PM -
User-578657687 posted
This error occured is not due to mix C# and VB in a Web site.
Parser Error Message: Could not load type '_success'.
I think you need to comfirm if the class name in the .aspx.vb file is the same as value of Inherits in .aspx file.
"Could not load type '_success'", your
Partial Class _success Inherits System.Web.UI.Page
code behind should be like this:
- Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
Tuesday, June 28, 2011 4:50 AM