I have an ASPX file with this button:
<asp:button id="cmdPartnerInfo" runat="server" Font-Bold="True"
Text="Partner Info" TabIndex="3">
</asp:button>
And in the ASPX.VB file I have this Sub:
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
cmdPartnerInfo.Attributes.Add("onclick", "return ShowPartnerContatcInfo();")
imgStaff.Attributes.Add("onclick", "return AddStaffSelection();")
lblDt.Text = ""
... snip ...
End Sub
However, there is a squiggly line under cmdPartnerInfo and the message is:
Error 38 'cmdPartnerInfo' is not declared. It may be inaccessible due to its
protection level.
So it looks like the code in the vb file doesn’t see the asp control in the aspx page.
Any help figuring out why this is happening is appreciated.
Thanks!
Eric
UPDATE:
These are the two directives at the top of the ASPX page.
<%@ Register TagPrefix="Card" TagName="Banner" Src="~/banner.ascx" %>
<%@ Page Language="vb" AutoEventWireup="false" CodeFile="projectpartlog.aspx.vb" Inherits="Project_and_Partners_Log" %>
This directive means:
projectpartlog.aspx.vbThe Class name in the
projectpartlog.aspx.vbfile should beProject_and_Partners_Log