473,385 Members | 1,707 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,385 software developers and data experts.

Code behind error

(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_ri ghtworkuniforms.ascx"))
Case = "5"

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

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

--
************************************************** *****************************************
It is never too late to be what you could have been.
Nov 18 '05 #1
1 999
Ok Found out it was an issue of Case Sensitivity. AGAIN!

Laura K
"Laura K" <kl*******@ATcharter.net> wrote in message
news:%2******************@TK2MSFTNGP10.phx.gbl...
(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_ri ghtworkuniforms.ascx"))
Case = "5"

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

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

--
************************************************** *****************************************
It is never too late to be what you could have been.

Nov 18 '05 #2

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

8
by: Brett Robichaud | last post by:
I understand how code-behind can handle events for a page, but can I call a code-behind method from within a <script> tag in my ASP.Net page, or can I only call methods defined in other <script>...
1
by: William Parker | last post by:
I have a web control I made called header.ascx. It has its own properties and methods I defined. But I cannot figure out how to access this control from my code behind page. I can create the...
1
by: Ken.r | last post by:
I'm working my way throught ASP Resource Kit tutorial lab 3. This following code was working in the HTML page: private void btnSignIn_Click(object sender, System.EventArgs e) { // Add user...
2
by: Ric | last post by:
im new to asp.net. from what i understand, you have the aspx file (presentation), user-control(ascx file), code-behind(vb file) and components(compiled vb and dll files). the aspx file contains a...
171
by: tshad | last post by:
I am just trying to decide whether to split my code and uses code behind. I did it with one of my pages and found it was quite a bit of trouble. I know that most people (and books and articles)...
2
by: N. Demos | last post by:
I have a user control with code behind of which two instances are created/declared in my aspx page. The aspx page has code behind also, as I need to access methods of the usercontrols on page...
29
by: John Rivers | last post by:
Hello, What good reason there is for not allowing methods in ASPX pages I can't imagine, but here is how to get around that limitation: (START) <body MS_POSITIONING="FlowLayout"> <form...
1
by: Me | last post by:
Hi, I inherited a web application that has several very similar forms for gathering user data. User's must choose the form that best fits their needs and fill it out. Each form has about 15...
1
by: pbishop | last post by:
Hi, I'm fairly new to ASP.Net. I have Visual Web Developer 2005 Express. Except for the default.aspx, whenever I create a new Web form, no code behind (aspx.vb) page is created. The same thing...
8
by: Brett | last post by:
I wrote an ASP.NET application that queries a SQL Server database (on a different box from the web server) and displays the result in a GridView. The datasource for the GridView is a SQLDataSource....
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
0
by: ryjfgjl | last post by:
In our work, we often need to import Excel data into databases (such as MySQL, SQL Server, Oracle) for data analysis and processing. Usually, we use database tools like Navicat or the Excel import...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.