Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ASPX: Placeholder not declared

Tags:

asp.net

vb.net

Actually i'm trying to add another placeholder to my code, in aspx it's look's like the following

  <asp:PlaceHolder ID="countPlace" runat="server"></asp:PlaceHolder>

While in codebehind i'm trying to do the following

  countPlace.Controls.Add(New LiteralControl(footer.ToString))

But i'm getting the error BC30451 which say that countPlace is not declared.

While i'm trying to use countPlace in codebehind i get a warning error which says "change item context"

enter image description here

like image 672
NiceToMytyuk Avatar asked Mar 17 '26 12:03

NiceToMytyuk


1 Answers

By adding CodeBehind solved that problem, but actually i can't understand why the other two PlaceHolder was anyway detected without it.

So i just changed from :

<%@ Page Language="vb" AutoEventWireup="false" CodeFile="Default.aspx.vb" Inherits="_Default" %>

To:

<%@ Page Language="vb" AutoEventWireup="false" CodeFile="Default.aspx.vb" CodeBehind="~/Default.aspx.vb" Inherits="_Default" %>
like image 174
NiceToMytyuk Avatar answered Mar 20 '26 03:03

NiceToMytyuk



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!