473,326 Members | 2,110 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,326 software developers and data experts.

The directive 'Control' is unknown.

Working on an ASP.NET project recently, I was trying to put a customer
control into use, and kept receiving this 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: The directive 'Control' is unknown.

The web site that had the tutorial did not describe this error, and yet I
copied their code exactly. I searched the web and could not find a
definitive answer to this problem. Eventually, I found the cause of my
problem, so I thought I would post the solution here so 1) the experts could
validate my findings and 2) other newbs could possible stumble across this
post and save themselves some time.

The code I had copied was intended to be in a ASCX (a user control), whereas
I was using the code in an ASPX (a web form). In the web form, I simply
deleted the line:

<%@ Control Language="vb" AutoEventWireup="false"
Codebehind="MyControl.ascx.vb"
Inherits="MyControl.MyControl"
TargetSchema="http://schemas.microsoft.com/intellisense/ie5" %>

And this solved my problem. This directive is only used within a user
control, not a web form.

BV.
Nov 21 '05 #1
1 6421
Yes, pasting incorrect code into a project may break it. There are many
other examples

Jeff
"Benign Vanilla" <BV************@tibetanbeefgarden.com> wrote in message
news:2v*************@uni-berlin.de...
Working on an ASP.NET project recently, I was trying to put a customer
control into use, and kept receiving this 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: The directive 'Control' is unknown.

The web site that had the tutorial did not describe this error, and yet I
copied their code exactly. I searched the web and could not find a
definitive answer to this problem. Eventually, I found the cause of my
problem, so I thought I would post the solution here so 1) the experts could validate my findings and 2) other newbs could possible stumble across this
post and save themselves some time.

The code I had copied was intended to be in a ASCX (a user control), whereas I was using the code in an ASPX (a web form). In the web form, I simply
deleted the line:

<%@ Control Language="vb" AutoEventWireup="false"
Codebehind="MyControl.ascx.vb"
Inherits="MyControl.MyControl"
TargetSchema="http://schemas.microsoft.com/intellisense/ie5" %>

And this solved my problem. This directive is only used within a user
control, not a web form.

BV.

Nov 21 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Larry Martin | last post by:
I am trying to run a Java Applet on my ascx page and am getting an IO exception when IE6 tries to load the applet. It seems a lot of others are getting the same problem but a search of the web did...
2
by: Mantorok Redgormor | last post by:
what is the purpose of the #line directive? how is it suppose to be used? I didn't see it mentioned in the faq and I can't make any sense of it from the standard. -- nethlek
13
by: DevarajA | last post by:
What is #pragma used for?
2
by: Keith | last post by:
I am trying to create the Chart application from Chapter 27 in ASP.net Unleashed. When I go to load my page I receive the following error message: Server Error in '/' Application. ...
0
by: Sergey Polyakov | last post by:
Hello everybody! I am authoring my custom webcontrol and faced a very difficult problem. I have two assemblies: the first one contains some base classes and the second one contains a class which...
1
by: tshad | last post by:
I just started playing with User Controls and I found that some books have the @Control directives in them and some don't. Why is that? When do you have to have it? For example: I could...
1
by: Andy B | last post by:
I have the following directive in my master page (the actual file name is Layout.master): <%@ MasterType VirtualPath="MasterPage.master" %> When I run the website, I get this error: "Parser Error...
2
by: Calvin Cheng | last post by:
Hi, I am attempting to convert a bunch of .txt files into html using the docutils package. It works for most of the txt files except for the index.txt file which gives 2 errors: (1)...
0
by: Frank Swarbrick | last post by:
Does anyone have any idea what the following file might be, and why it gets created? C:\Documents and Settings\FJSwarbrick\Application Data\IBM\DB2\db2tools\.databean.jdbclob It appears to be...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.