Error 227 'QQQ' is not declared.

C

Cal Who

I have many files like this one with identical statements for the
MasterType, Content and for:

<div id="QQQ">

and for the script shown below.



A couple of those files cause the error:

Error 227 'QQQ' is not declared. It may be inaccessible due to its
protection level.

The following markup is from one of those files.

What could possibly be the problem with this file?



Thanks



<%@ Page Language="VB" MasterPageFile="~/Main.master"
AutoEventWireup="false" CodeFile="2010Events.aspx.vb"

Inherits="Calendar_2010Events" Title="View a Few Events" %>

<%@ MasterType TypeName="BaseMaster" %>

<asp:Content ID="Content8" ContentPlaceHolderID="BottomImageCPH"
runat="Server">

<div id="QQQ">

<h4>

2010 MEETINGS and OTHER EVENTS</h4>

<div runat="server" style="overflow: auto;" id="Events2010">

This text gets replaced</div>

</div>

<script type="text/javascript">

//Must be run after the element is rendered

SetMargins('<%=QQQ.ClientID%>');

</script>

</asp:Content>

No code in the code behind
 
C

Cal Who

Two new notes:

It is not true that many files do not cause the error:
Whenever I open one of the files its error get added to the list. (I didn't
know that before)

The error message points to line 1 (the <%@ Page)
Doesn't mean anything to me but I'd guess that is significant
 
H

Harlan Messinger

Cal said:
I have many files like this one with identical statements for the
MasterType, Content and for:

<div id="QQQ">

and for the script shown below.

A couple of those files cause the error:

Error 227 'QQQ' is not declared. It may be inaccessible due to its
protection level.
[snip]

<div id="QQQ">
[snip]

<script type="text/javascript">

//Must be run after the element is rendered

SetMargins('<%=QQQ.ClientID%>');

</script>

</asp:Content>

Ordinary HTML tags aren't represented in the page's ASP.NET object
model. If you want a DIV in the generated HTML that's addressable within
the .NET code, use an ASP:panel control.
 
C

Cal Who

Harlan Messinger said:
Cal said:
I have many files like this one with identical statements for the
MasterType, Content and for:

<div id="QQQ">

and for the script shown below.

A couple of those files cause the error:

Error 227 'QQQ' is not declared. It may be inaccessible due to its
protection level.
[snip]

<div id="QQQ">
[snip]

<script type="text/javascript">

//Must be run after the element is rendered

SetMargins('<%=QQQ.ClientID%>');

</script>

</asp:Content>

Ordinary HTML tags aren't represented in the page's ASP.NET object model.
If you want a DIV in the generated HTML that's addressable within the .NET
code, use an ASP:panel control.

How about adding runat:="server"
Would that be as good?

Thanks
 
H

Harlan Messinger

Cal said:
Harlan Messinger said:
Cal said:
I have many files like this one with identical statements for the
MasterType, Content and for:

<div id="QQQ">

and for the script shown below.

A couple of those files cause the error:

Error 227 'QQQ' is not declared. It may be inaccessible due to its
protection level. [snip]

<div id="QQQ"> [snip]

<script type="text/javascript">

//Must be run after the element is rendered

SetMargins('<%=QQQ.ClientID%>');

</script>

</asp:Content>
Ordinary HTML tags aren't represented in the page's ASP.NET object model.
If you want a DIV in the generated HTML that's addressable within the .NET
code, use an ASP:panel control.

How about adding runat:="server"
Would that be as good?

That does seem to suffice. I amend what I said earlier.
 
C

Cal Who

Ordinary HTML tags aren't represented in the page's ASP.NET object
This is what did the trick.

Thanks
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,764
Messages
2,569,566
Members
45,041
Latest member
RomeoFarnh

Latest Threads

Top