[Last Call] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

The language of the code file is inconsistent with the language of the page.

Posted on 2014-07-17
9
Medium Priority
?
328 Views
Last Modified: 2014-08-04
Hi all,

I am currently getting the error "The language of the code file is inconsistent with the language of the page."
I now this error points to me using c# and vb.net on the same page but from what i can tell im not :S

What im doing is creating a UserControl to have my login system in:

in my Default.aspx file i have added the following code

<%@ Page Language="VB" AutoEventWireup="false" CodeFile="Default.aspx.vb" Inherits="home" %>
 <%@ Register TagPrefix="loginbox" TagName="loginbox" Src="Loginsystem/loginbox.ascx" %>
 <loginbox:loginbox runat="server" ID="loginbox" />

Open in new window


and my loginbox.ascx contains the following

<%@ Control Language="VB" AutoEventWireup="true" CodeFile="loginbox.ascx.cs" Inherits="loginbox" %>
test the login

Open in new window


any ideas why i would get the error and a fix?
0
Comment
Question by:runnerjp2005
9 Comments
 
LVL 45

Expert Comment

by:AndyAinscow
ID: 40201735
>>I now this error points to me using c# and vb.net on the same page but from what i can tell im not

CodeFile="Default.aspx.vb"
is Visual Basic

and
CodeFile="loginbox.ascx.cs"
is C sharp


Is that your problem ?
0
 

Author Comment

by:runnerjp2005
ID: 40201750
<%@ Control Language="VB" AutoEventWireup="true" CodeFile="loginbox.aspx.vb" Inherits="loginbox" %>

i changed it but get the error The directive 'control' is unknown.
0
 
LVL 143

Expert Comment

by:Guy Hengel [angelIII / a3]
ID: 40201757
it should be Page and not Control there...
0
Veeam Disaster Recovery in Microsoft Azure

Veeam PN for Microsoft Azure is a FREE solution designed to simplify and automate the setup of a DR site in Microsoft Azure using lightweight software-defined networking. It reduces the complexity of VPN deployments and is designed for businesses of ALL sizes.

 

Author Comment

by:runnerjp2005
ID: 40201773
Now i get the error Type 'ASP.loginsystem_loginbox_aspx' does not inherit from 'System.Web.UI.UserControl'.
0
 
LVL 143

Expert Comment

by:Guy Hengel [angelIII / a3]
ID: 40201780
which is another problem...
and you will need to provide the relevant code of that usercontrol
0
 

Author Comment

by:runnerjp2005
ID: 40201802
<%@ Register TagPrefix="loginbox" TagName="loginbox" Src="Loginsystem/loginbox.aspx" %>
0
 
LVL 143

Expert Comment

by:Guy Hengel [angelIII / a3]
ID: 40201815
that is not the relevant part of the usercontrol itself
0
 

Author Comment

by:runnerjp2005
ID: 40204235
this is all the coding i have:

Default.aspx

<%@ Page Language="VB" AutoEventWireup="false" CodeFile="Default.aspx.vb" Inherits="home" %>
 <%@ Register TagPrefix="loginbox" TagName="loginbox" Src="Loginsystem/loginbox.aspx" %>
 <loginbox:loginbox runat="server" ID="loginbox" />

Open in new window


loginbox.aspx

<%@ Page Language="VB" AutoEventWireup="true" CodeFile="loginbox.aspx.vb" Inherits="loginbox" %>
test the login

Open in new window

0
 
LVL 83

Accepted Solution

by:
CodeCruiser earned 2000 total points
ID: 40204352
><%@ Register TagPrefix="loginbox" TagName="loginbox" Src="Loginsystem/loginbox.aspx" %>

You are trying to use another page like a user control.

Here is a tutorial to get you started

http://msdn.microsoft.com/en-us/library/26db8ysc(v=vs.85).aspx
0

Featured Post

Prep for the ITIL® Foundation Certification Exam

December’s Course of the Month is now available! Enroll to learn ITIL® Foundation best practices for delivering IT services effectively and efficiently.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
Simulator games are perfect for generating sample realistic data streams, especially for learning data analysis. It is even useful for demoing offerings such as Azure stream analytics, PowerBI etc.
This Micro Tutorial will teach you how to add a cinematic look to any film or video out there. There are very few simple steps that you will follow to do so. This will be demonstrated using Adobe Premiere Pro CS6.
Integration Management Part 2
Suggested Courses

834 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question