PC Review


Reply
 
 
maya
Guest
Posts: n/a
 
      17th Jul 2006
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.

 
Reply With Quote
 
 
 
 
Thomas T. Veldhouse
Guest
Posts: n/a
 
      17th Jul 2006
maya <(E-Mail Removed)> wrote:
> 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

 
Reply With Quote
 
maya
Guest
Posts: n/a
 
      17th Jul 2006
Thomas T. Veldhouse wrote:
> maya <(E-Mail Removed)> wrote:
>> 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.
>>

>

 
Reply With Quote
 
Tom Spink
Guest
Posts: n/a
 
      17th Jul 2006
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.
 
Reply With Quote
 
Bjorn Abelli
Guest
Posts: n/a
 
      17th Jul 2006

"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


 
Reply With Quote
 
maya
Guest
Posts: n/a
 
      17th Jul 2006
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...


 
Reply With Quote
 
Chris Dunaway
Guest
Posts: n/a
 
      17th Jul 2006
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

 
Reply With Quote
 
maya
Guest
Posts: n/a
 
      18th Jul 2006
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!


 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Help for compiling delphine_fontaine@yahoo.com Microsoft C# .NET 2 18th Jan 2006 07:00 PM
compiling a DLL Luigi Puleio Microsoft VC .NET 2 29th Jun 2004 07:49 AM
Compiling with .NET 1.0 Matt Tapia Microsoft Dot NET Compact Framework 1 8th Jun 2004 08:16 PM
Stop compiling doesn't stop compiling Rudy Ray Moore Microsoft VC .NET 0 5th May 2004 12:50 AM
vb.net compiling Tim Shelton Microsoft VB .NET 4 24th Apr 2004 11:41 AM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 05:03 PM.