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

ClassName case sensitive

I had a problem with some webforms and user controls. From time to time when
developing a new form or user control and testing I got the following error:

Could not load type 'xml.WebForm1'

I use to fight with this for a while and I allways endend up deleting the
form and starting again. Then it worked.

BUT TODAY I FOUND MY PROBLEM!

This error was showing becase on the <@page> or <@control> directive I had
an Inherits clause that pointed to a class which was slightly misspelled:

<%@ Page Language="vb" AutoEventWireup="false" Codebehind="WebForm1.aspx.vb"
Inherits="xml.WebForm1"%>

and in the code behind file I had:

Public Class webForm1
Inherits System.Web.UI.Page
....

Notice the difference in the initial character of the className: just a
lowercase or uppercase difference. I've found the same problem with user
controls.

I've tried with different projects and I get the same result on all. It's
quite easy to reproduce:

create a new web project (defaults with WebForm1.aspx)
compile and run
---> it works

change the inherits clause on the <@ page> directive (just upper or lower
case, for example to Webform1
compile and run
----> it doesn't work

Why? Please can someone give a reason of this behaviour?

Vicenç
Nov 20 '05 #1
1 1408
"Vicenç Masanas" <vm******@pas.udg.es> wrote in message
news:%2****************@TK2MSFTNGP09.phx.gbl...
Notice the difference in the initial character of the className: just a
lowercase or uppercase difference. I've found the same problem with user
controls.

Why? Please can someone give a reason of this behaviour?


Name lookup in the .Net Framework is case sensitive. This is reflected in
languages such as C#, where 'somename', 'Somename', 'someName' are all
different entities. Although Visual Basic as a language is not case
sensitive, this is just the Visual Basic compiler abstracting away the case
sensitivity of the CLR. The VB compiler takes extra effort to produce IL
code where the names do match. So if you declare your class webForm1, but
reference it somewhere else as WebForm1, the IL the VB compiler will emit
will actually make that reference read webForm1 to have the case match.

Apparently, the @page directive in ASP.NET, which is after all used by all
languages, not just VB, does not have this feature. So lookup is case
dependant.

--
Sven Groot
Nov 20 '05 #2

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

Similar topics

32
by: Elliot Temple | last post by:
Hi I have two questions. Could someone explain to me why Python is case sensitive? I find that annoying. Also, why aren't there multiline comments? Would adding them cause a problem of some...
9
by: Paul Smith | last post by:
This doesn't seem like it should be *that* difficult, but after quite some time trying to figure it out, I'm still banging my head against the wall. My objective is to examine the exact...
5
by: Madjid Nasiri | last post by:
Hi, I am basic in oracle. My Old programs write with Delphi and Databases: Access, Paradox, MySQL, Microsoft SQL. I write my code (SQL code) case-insensitivae, but now i need use oracle database....
2
by: J. Muenchbourg | last post by:
I'm doing a few tests with simple .net scripts, and I noticed that I display the following error message at ErrMessage.Text if I don't enter "BLUE" in capital letters into my input textbox: ...
4
by: xAvailx | last post by:
Hello: I didn't find any documentation that notes save point names are case sensitive, but I guess they are... Stored Proc to reproduce: /* START CODE SNIPPET */ If Exists (Select * From...
38
by: Bart | last post by:
Why is C case sensitive? I know it's a bit late to change it now but there would seem to be far more advantages in ignoring letter case in source code. In real life such a situation would be...
2
by: Lucky | last post by:
Hi guys, I'm having problem with case sensitive collation of SQL Database. one my client is having case sensitive database. While developing the Data Layer i didn't consider this scenario. the...
9
by: =?Utf-8?B?QWJoaQ==?= | last post by:
i was looking in some code in which i found that it is using @ keyword before class name and constructor like this public class @MyClass { public @MyClass { } }
11
by: Rafe | last post by:
Hi, I'm working within an application (making a lot of wrappers), but the application is not case sensitive. For example, Typing obj.name, obj.Name, or even object.naMe is all fine (as far as...
0
by: ryjfgjl | last post by:
ExcelToDatabase: batch import excel into database automatically...
0
by: Vimpel783 | last post by:
Hello! Guys, I found this code on the Internet, but I need to modify it a little. It works well, the problem is this: Data is sent from only one cell, in this case B5, but it is necessary that data...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
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...
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...

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.