Error 227 'QQQ' is not declared.

  • Thread starter Thread starter Cal Who
  • Start date Start date
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
 
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
 
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.
 
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
 
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.
 
Ordinary HTML tags aren't represented in the page's ASP.NET object
This is what did the trick.

Thanks
 
Back
Top