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

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?
runnerjp2005Asked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

AndyAinscowFreelance programmer / ConsultantCommented:
>>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
runnerjp2005Author Commented:
<%@ Control Language="VB" AutoEventWireup="true" CodeFile="loginbox.aspx.vb" Inherits="loginbox" %>

i changed it but get the error The directive 'control' is unknown.
0
Guy Hengel [angelIII / a3]Billing EngineerCommented:
it should be Page and not Control there...
0
Cloud Class® Course: MCSA MCSE Windows Server 2012

This course teaches how to install and configure Windows Server 2012 R2.  It is the first step on your path to becoming a Microsoft Certified Solutions Expert (MCSE).

runnerjp2005Author Commented:
Now i get the error Type 'ASP.loginsystem_loginbox_aspx' does not inherit from 'System.Web.UI.UserControl'.
0
Guy Hengel [angelIII / a3]Billing EngineerCommented:
which is another problem...
and you will need to provide the relevant code of that usercontrol
0
runnerjp2005Author Commented:
<%@ Register TagPrefix="loginbox" TagName="loginbox" Src="Loginsystem/loginbox.aspx" %>
0
Guy Hengel [angelIII / a3]Billing EngineerCommented:
that is not the relevant part of the usercontrol itself
0
runnerjp2005Author Commented:
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
CodeCruiserCommented:
><%@ 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

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Visual Basic.NET

From novice to tech pro — start learning today.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.