473,398 Members | 2,125 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,398 software developers and data experts.

Where do I put the .cs file for this user control?

Hello,

I have a user control that can show info in a number of different ways.
I do this by having several .ascx files, all of which refer to the same
..cs file.

I can't work out where to put this .cs file so that it will work. The
..ascx files are in the root of the web site, and if I put the .cs file
in there, then the compiler gives me the error "Unable to cast object of
type 'ASP.ShowCategory' to type 'ShowCategory" which I assume means it
can't find the class. If I put the .cs file in the App_Code folder, then
it tells me that is not allowed.

In case it helps, the top of one of the .ascx files looks like...

<%@ Language="C#" Inherits="ShowCategory" ClassName="ShowCategory"
CodeFile="ShowCategory.cs" %>

and the top of the .cs file (ignoring "using" statements) looks like...

public partial class ShowCategory : UserControl {

Any ideas? I'm really stuck here. TIA

--
Alan Silver
(anything added below this line is nothing to do with me)
Mar 8 '06 #1
1 1210
Assuming that this would have worked in VS2003, there is a MS kit
available (I'm pretty sure) that let's you create projects in VS2005
just like you would in VS2003. Perhaps it will be part of a service
pack. But it all just makes me sooo confused.
I'll leave it to you to google for it. Or look on msdn.
Alan Silver wrote:
Hello,

I have a user control that can show info in a number of different ways.
I do this by having several .ascx files, all of which refer to the same
.cs file.

I can't work out where to put this .cs file so that it will work. The
.ascx files are in the root of the web site, and if I put the .cs file
in there, then the compiler gives me the error "Unable to cast object of
type 'ASP.ShowCategory' to type 'ShowCategory" which I assume means it
can't find the class. If I put the .cs file in the App_Code folder, then
it tells me that is not allowed.

In case it helps, the top of one of the .ascx files looks like...

<%@ Language="C#" Inherits="ShowCategory" ClassName="ShowCategory"
CodeFile="ShowCategory.cs" %>

and the top of the .cs file (ignoring "using" statements) looks like...

public partial class ShowCategory : UserControl {

Any ideas? I'm really stuck here. TIA

--
Alan Silver
(anything added below this line is nothing to do with me)


Mar 8 '06 #2

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

Similar topics

2
by: Jody Burgess | last post by:
Hi; I am writing my first python program and would like to know how to change stdout to refer to my default printer or any other printer on my network. The other question is, Is there an API set...
1
by: paja | last post by:
Hello All I have been trying looking for Slider control required for one of the application. I have looked in default Form controls, then tried to add controls from COM components, but could not...
1
by: Dave | last post by:
I've built a custom server control that reads an xml file and builds a left side navigation system. When I drop that server control into a user control that will hold the left side navigation for...
4
by: sunilj20 | last post by:
Hello, I have a requirement wherein, a user clicks on a file name in an ASP.NET web application, and the file should automatically be downloaded (Without showing the "Open", "Save As") in the...
3
by: Scott Gunn | last post by:
Hello I have vb.net 2003 but I cannot find CrystalDecisions. How can I get/install it? TBS
1
by: rdemyan via AccessMonster.com | last post by:
I'm trying to implement a licensing scheme. There are three types of licenses: Trial - good for 30 to 60 days Interim - good for 1 year Fully Paid - no expiration Everything is working fine...
10
by: Paul Cheetham | last post by:
Hi, I am developing an application that needs to store some machine-specific settings. The application is going to be published on the network in order to keep the clients on the latest version....
1
by: tony | last post by:
Hello! I just want to find out how the system find the name to set on a assembly User control dll. I have done this. 1. Create a user control - Here the namespace was set by the system to...
11
by: Alan T | last post by:
I added a resource file into my project, to store the caption of buttons and labels.. How do I make use of this resource file to dynamically assign to the buttons and labels ?
20
by: David Thielen | last post by:
Hi; When we add a reference to a web app, where is that information stored? There is no project file, it's not in the web.config or solution file. ??? - thanks - dave ...
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...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
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...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

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.