Unable to access controls on the page
-
I am trying to set image visibility based on some user information. Howver I always receive the following error message Compiler Error Message: CS1061: 'XXX.SearchAcme' does not contain a definition for 'acmeBlemont' and no extension method 'acmeBlemont' accepting a first argument of type 'XXX.SearchAcme' could be found (are you missing a using directive or an assembly reference?) This is my markup and code behind so far...any ideas what the problem could be? I can't seem to figure out what the problem is. Using FindControl did not work either and while debugging the page only seems to have 1 control in the ControlCollection. However, when you hover over "this" on a breakpoint, you can drill down and see the images.
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Search.aspx.cs" src="Search.aspx.cs" Inherits="XXX.SearchAcme"
MasterPageFile="~/Center/Lobby.Master" %><asp:Content ID="Content1" ContentPlaceHolderID="SponsorContent" runat="server">
<img id="acmeBlemont" runat="server" src="/acme/common/custom_images/weblet4_belmont.gif" width="170" height="45" border="0" visible="false" />
<asp:Image id="acmeVerde" name="acmeVerde" runat="server" ImageUrl="/acme/common/custom_images/weblet4_verde.gif" width="170" height="45" border="0" visible="false" />
</asp:Content>namespace XXX
{
public partial class SearchAcme : AdvisorPage
{
public SearchAcme()
: base(ProgressNavIds.ChooseSearchOption)
{} protected override void OnPreRender(EventArgs e) { base.OnPreRender(e); this.acmeBlemont.Visible = true; } }
}
-
I am trying to set image visibility based on some user information. Howver I always receive the following error message Compiler Error Message: CS1061: 'XXX.SearchAcme' does not contain a definition for 'acmeBlemont' and no extension method 'acmeBlemont' accepting a first argument of type 'XXX.SearchAcme' could be found (are you missing a using directive or an assembly reference?) This is my markup and code behind so far...any ideas what the problem could be? I can't seem to figure out what the problem is. Using FindControl did not work either and while debugging the page only seems to have 1 control in the ControlCollection. However, when you hover over "this" on a breakpoint, you can drill down and see the images.
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Search.aspx.cs" src="Search.aspx.cs" Inherits="XXX.SearchAcme"
MasterPageFile="~/Center/Lobby.Master" %><asp:Content ID="Content1" ContentPlaceHolderID="SponsorContent" runat="server">
<img id="acmeBlemont" runat="server" src="/acme/common/custom_images/weblet4_belmont.gif" width="170" height="45" border="0" visible="false" />
<asp:Image id="acmeVerde" name="acmeVerde" runat="server" ImageUrl="/acme/common/custom_images/weblet4_verde.gif" width="170" height="45" border="0" visible="false" />
</asp:Content>namespace XXX
{
public partial class SearchAcme : AdvisorPage
{
public SearchAcme()
: base(ProgressNavIds.ChooseSearchOption)
{} protected override void OnPreRender(EventArgs e) { base.OnPreRender(e); this.acmeBlemont.Visible = true; } }
}
I've tried this and managed to reproduce your error. Suprisingly, removing the following attribute from your page declaration seems to resolve it.
src="Search.aspx.cs"
-
I've tried this and managed to reproduce your error. Suprisingly, removing the following attribute from your page declaration seems to resolve it.
src="Search.aspx.cs"