Code behind error

L

Laura K

(Using VB)

I created a conditional statement to put a control into a placeholder
depending on criteria. It worked fine. I then took that code into a
seperate vb page and called it from the initial page. It doesn't work now.
I am getting an error:

The base type 'sidebar' does not exist in the source file 'sidebar.vb

Can someone take a look at my code and help me out? Thanks
.............................................................................................................................

The Initial page that I have uses the page directive as follows:

<%@LANGUAGE="VBSCRIPT" CODEPAGE="1252" Debug="true" inherits="sidebar"
src="sidebar.vb"%>

...............................................................................................................
The actual placeholder on page one looks like this

<asp:placeholder id="placeholder1" runat="Server" />
..............................................................................................................

(note that in this page I had to add: Public Placeholder1 as placeholder
which I did not when the coding was on the initial page)

The code behind page looks like this
Imports System
Imports System.Web.UI
imports System.Web.UI.WebControls

Public Class Sidebar
Inherits Page
Public Placeholder1 as placeholder
Sub Page_Load(sender As Object, e As System.EventArgs)
Select Case Request.QueryString("strCSSPath").ToString()
Case = "7"
PlaceHolder1.Controls.Add(Page.LoadControl("inc_rightworkuniforms.ascx"))
Case = "5"

PlaceHolder1.Controls.Add(Page.LoadControl("inc_rightboots.ascx"))
Case Else

PlaceHolder1.Controls.Add(Page.LoadControl("inc_rightdickies.ascx"))
End Select
End Sub
end Class
 

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

Top