By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
443,313 Members | 1,145 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 443,313 IT Pros & Developers. It's quick & easy.

Session & Service keywords conflict....

P: n/a
I am a current ASP developer.

I have files: ServiceClass.asp & SessionClass.asp which are included in many
of my asp files. Then they call objService = New Service (by using the Class
Service from ServiceClass.asp file).

Is it true that ASP.NET does not allow you to use Service or Session words
as they are keywords in ASP.NET?
Mar 21 '06 #1
Share this Question
Share on Google+
3 Replies


P: n/a
No, it is not true. Neither is a VB.NET keyword. And there is no such thing
as an 'ASP.NET keyword' because you are always writing your code in some
language, so all the keywords are keywords of that language.

There is a Session property of the Page class. I don't know about Service,
I don't remember seeing one. In any case, you can still call classes
Session and Service, you may just end up doing a little more typing so the
compiler can differentiate them.

"Dhruba Bandopadhyay" <dh*****************@hotmail.com> wrote in message
news:e6**************@tk2msftngp13.phx.gbl...
I am a current ASP developer.

I have files: ServiceClass.asp & SessionClass.asp which are included in
many of my asp files. Then they call objService = New Service (by using
the Class Service from ServiceClass.asp file).

Is it true that ASP.NET does not allow you to use Service or Session words
as they are keywords in ASP.NET?

Mar 21 '06 #2

P: n/a

If there is a naming conflict, you have to use the fully qualified object
name sometimes.

Aka..if you code up a page.. and

you create a namespace/object called

MyApplication.EventArgs.MySomethingEventArgs (where MySomethingEventArgs is
the object name)(and MyApplication.EventArgs is the namespace)
and then you want to use the Microsoft .... System.EventArgs
System.EventArgs

You'll have to code your object as

MyApplication.EventArgs.MySomethingEventArgs abc = new
MyApplication.EventArgs.MySomethingEventArgs();

instead of the shorthand

MySomethingEventArgs abc = new MySomethingEventArgs();

....

this is why some people will just naturally avoid namespacing
conflicts...but its not Forbidden/unworkable.


"Marina Levit [MVP]" <so*****@nospam.com> wrote in message
news:%2*****************@TK2MSFTNGP12.phx.gbl...
No, it is not true. Neither is a VB.NET keyword. And there is no such thing as an 'ASP.NET keyword' because you are always writing your code in some
language, so all the keywords are keywords of that language.

There is a Session property of the Page class. I don't know about Service, I don't remember seeing one. In any case, you can still call classes
Session and Service, you may just end up doing a little more typing so the
compiler can differentiate them.

"Dhruba Bandopadhyay" <dh*****************@hotmail.com> wrote in message
news:e6**************@tk2msftngp13.phx.gbl...
I am a current ASP developer.

I have files: ServiceClass.asp & SessionClass.asp which are included in
many of my asp files. Then they call objService = New Service (by using
the Class Service from ServiceClass.asp file).

Is it true that ASP.NET does not allow you to use Service or Session words as they are keywords in ASP.NET?


Mar 21 '06 #3

P: n/a
Dhruba,

If you had used Service.asp or Session.asp you'd have a problem, but I
believe .NET will not give you any trouble with ServiceClass or SessionClass
those will be treated as a different object.

Regards,

--
S. Justin Gengo
Web Developer / Programmer

Free code library:
http://www.aboutfortunate.com

"Out of chaos comes order."
Nietzsche
"Dhruba Bandopadhyay" <dh*****************@hotmail.com> wrote in message
news:e6**************@tk2msftngp13.phx.gbl...
I am a current ASP developer.

I have files: ServiceClass.asp & SessionClass.asp which are included in
many of my asp files. Then they call objService = New Service (by using
the Class Service from ServiceClass.asp file).

Is it true that ASP.NET does not allow you to use Service or Session words
as they are keywords in ASP.NET?

Mar 21 '06 #4

This discussion thread is closed

Replies have been disabled for this discussion.