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

compiling..

P: n/a
hi,

I'm following example 'Intro7.aspx' here,
http://www.csharpfriends.com/quickst...px#customctrls

it says on top of Acme.cs "namespace Acme" I assume this means Acme.cs
has to be in a dir called 'Acme'? (am assuming namespace is equiv to
Java's packages; is this right?)

at any rate I can't compile Acme.cs.. get errors (I'm compiling in
command line, thus: csc.exe Acme.cs.. get lots of errors, dealing mostly
with obsolete stuff..)

I'm also confused about two other things:

1) I don't see this, CodeFile="Acme.cs" anywhere in aspx.. (going by
what I see where I work, just started working here & trying to learn
..NET..)

2) Acme.cs starts with

public class Calendar : Control, IPostBackEventHandler,
IPostBackDataHandler

but Control is a class, not an interface (can u implement classes?)

thank you.

Jul 17 '06 #1
Share this Question
Share on Google+
7 Replies


P: n/a
maya <ma********@yahoo.comwrote:
hi,

I'm following example 'Intro7.aspx' here,
http://www.csharpfriends.com/quickst...px#customctrls
I think we could answer these questions, but there would be more to follow ...
a lot more. Honestly, I think what you really need is a good book to sit down
with and learn.

Since you are working with an ASP application, consider:

http://www.bookpool.com/sm/0470042583

Or, if you really just need C# (my recommendation to start), how about:

http://www.bookpool.com/sm/0735621292
or
http://www.bookpool.com/sm/0764578472

it says on top of Acme.cs "namespace Acme" I assume this means Acme.cs
has to be in a dir called 'Acme'? (am assuming namespace is equiv to
Java's packages; is this right?)

at any rate I can't compile Acme.cs.. get errors (I'm compiling in
command line, thus: csc.exe Acme.cs.. get lots of errors, dealing mostly
with obsolete stuff..)

I'm also confused about two other things:

1) I don't see this, CodeFile="Acme.cs" anywhere in aspx.. (going by
what I see where I work, just started working here & trying to learn
.NET..)

2) Acme.cs starts with

public class Calendar : Control, IPostBackEventHandler,
IPostBackDataHandler

but Control is a class, not an interface (can u implement classes?)

thank you.
--
Thomas T. Veldhouse
Key Fingerprint: 2DB9 813F F510 82C2 E1AE 34D0 D69D 1EDC D5EC AED1

Jul 17 '06 #2

P: n/a
Thomas T. Veldhouse wrote:
maya <ma********@yahoo.comwrote:
>hi,

I'm following example 'Intro7.aspx' here,
http://www.csharpfriends.com/quickst...px#customctrls

I think we could answer these questions, but there would be more to follow ...
a lot more. Honestly, I think what you really need is a good book to sit down
with and learn.

Since you are working with an ASP application, consider:

http://www.bookpool.com/sm/0470042583

Or, if you really just need C# (my recommendation to start), how about:

http://www.bookpool.com/sm/0735621292
or
http://www.bookpool.com/sm/0764578472
ok, thanks, but this tutorial should include instructions so you can run
the example.. he doesn't even say the .cs needs to be compiled.. I
HAVE been looking at books, of course; have also seen this one,
http://www.amazon.com/gp/product/159...e=UTF8&s=books
anybody have any opinion on this one?

I'm a front-end developer here, but thought I'd try to understand some
back-end stuff to help me along.. I HAVE done back-end, mostly on Java,
but .NET is so different from anything I have ever seen, even the HTML
code is different with .NET.. so was just trying to learn the basics,
mainly re controls, etc..

thanks again..
>
>it says on top of Acme.cs "namespace Acme" I assume this means Acme.cs
has to be in a dir called 'Acme'? (am assuming namespace is equiv to
Java's packages; is this right?)

at any rate I can't compile Acme.cs.. get errors (I'm compiling in
command line, thus: csc.exe Acme.cs.. get lots of errors, dealing mostly
with obsolete stuff..)

I'm also confused about two other things:

1) I don't see this, CodeFile="Acme.cs" anywhere in aspx.. (going by
what I see where I work, just started working here & trying to learn
.NET..)

2) Acme.cs starts with

public class Calendar : Control, IPostBackEventHandler,
IPostBackDataHandler

but Control is a class, not an interface (can u implement classes?)

thank you.
Jul 17 '06 #3

P: n/a
maya wrote:
hi,

I'm following example 'Intro7.aspx' here,
http://www.csharpfriends.com/quickst...px#customctrls
>
it says on top of Acme.cs "namespace Acme" I assume this means Acme.cs
has to be in a dir called 'Acme'? (am assuming namespace is equiv to
Java's packages; is this right?)

at any rate I can't compile Acme.cs.. get errors (I'm compiling in
command line, thus: csc.exe Acme.cs.. get lots of errors, dealing mostly
with obsolete stuff..)

I'm also confused about two other things:

1) I don't see this, CodeFile="Acme.cs" anywhere in aspx.. (going by
what I see where I work, just started working here & trying to learn
.NET..)

2) Acme.cs starts with

public class Calendar : Control, IPostBackEventHandler,
IPostBackDataHandler

but Control is a class, not an interface (can u implement classes?)

thank you.
Hi Maya,
it says on top of Acme.cs "namespace Acme" I assume this means Acme.cs
has to be in a dir called 'Acme'? (am assuming namespace is equiv to
Java's packages; is this right?)
Not exactly. Unlike Java, class and namespace definitions within code-files
are not dependant on where they are in the file system. Basically, you can
put your code-file anywhere, and define any number of namespaces and public
classes in your code-file.
but Control is a class, not an interface (can u implement classes?)
You don't implement a class, you inherit a class. The syntax is valid, it's
the same as using the Java 'extends' clause:

public class Calendar extends Control implements IPostBackEventHandler {
...
}

--
Hope this helps,
Tom Spink

Google first, ask later.
Jul 17 '06 #4

P: n/a

"maya" wrote...

Thomas gave you excellent suggestion to where to begin, but I will anyway
answer some of the specific questions you had as well.
it says on top of Acme.cs "namespace Acme" I assume this means
Acme.cs has to be in a dir called 'Acme'? (am assuming namespace
is equiv to Java's packages; is this right?)
Not quite. Java's packages are used for both logical and physical
structuring, but in .NET it's "only" the logical structure.

You can have the source code anywhere you like, and the MSIL (roughly
corresponding to Java's bytecode) is put into an assembly.
public class Calendar : Control, IPostBackEventHandler,
IPostBackDataHandler

but Control is a class, not an interface (can u implement classes?)
Here it's actually similar to Java, that a class can extend only one
superclass, but implement many interfaces.

However, the syntax for extending and implementing is the same in C#, the
colon (:), which means that if it would have been Java, it would have looked
like:

public class Calendar
extends Control
implements IPostBackEventHandler, IPostBackDataHandler
/// Bjorn A
Jul 17 '06 #5

P: n/a
Tom Spink wrote:
maya wrote:
>hi,

I'm following example 'Intro7.aspx' here,
http://www.csharpfriends.com/quickst...px#customctrls
>it says on top of Acme.cs "namespace Acme" I assume this means Acme.cs
has to be in a dir called 'Acme'? (am assuming namespace is equiv to
Java's packages; is this right?)

at any rate I can't compile Acme.cs.. get errors (I'm compiling in
command line, thus: csc.exe Acme.cs.. get lots of errors, dealing mostly
with obsolete stuff..)

I'm also confused about two other things:

1) I don't see this, CodeFile="Acme.cs" anywhere in aspx.. (going by
what I see where I work, just started working here & trying to learn
.NET..)

2) Acme.cs starts with

public class Calendar : Control, IPostBackEventHandler,
IPostBackDataHandler

but Control is a class, not an interface (can u implement classes?)

thank you.

Hi Maya,
>it says on top of Acme.cs "namespace Acme" I assume this means Acme.cs
has to be in a dir called 'Acme'? (am assuming namespace is equiv to
Java's packages; is this right?)

Not exactly. Unlike Java, class and namespace definitions within code-files
are not dependant on where they are in the file system. Basically, you can
put your code-file anywhere, and define any number of namespaces and public
classes in your code-file.
>but Control is a class, not an interface (can u implement classes?)

You don't implement a class, you inherit a class. The syntax is valid, it's
the same as using the Java 'extends' clause:

public class Calendar extends Control implements IPostBackEventHandler {
...
}
thank you very much, Tom.. so the colon means: extend if class,
implement if interface.. interesting.. (just realized, btw, on this
example, since this is aspx and not a stand-alone .cs class, that I
probably need to do this in VS and run 'build' command, since .cs needs
to compile into a .dll and not .exe (when I compile with csc.exe in
command-line it compiles classes into .exe..)

again thanks...
Jul 17 '06 #6

P: n/a
maya wrote:
probably need to do this in VS and run 'build' command, since .cs needs
to compile into a .dll and not .exe (when I compile with csc.exe in
command-line it compiles classes into .exe..)
csc has a /target switch for choosing whether to compile an exe or dll.
For a .dll it is /target:library

Jul 17 '06 #7

P: n/a
Chris Dunaway wrote:
maya wrote:
>probably need to do this in VS and run 'build' command, since .cs needs
to compile into a .dll and not .exe (when I compile with csc.exe in
command-line it compiles classes into .exe..)

csc has a /target switch for choosing whether to compile an exe or dll.
For a .dll it is /target:library
thank you! :)
Jul 18 '06 #8

This discussion thread is closed

Replies have been disabled for this discussion.