p2p.wrox.com Forums

p2p.wrox.com Forums (http://p2p.wrox.com/index.php)
-   BOOK: Beginning Visual C# 2005 (http://p2p.wrox.com/forumdisplay.php?f=222)
-   -   what is asp.net (http://p2p.wrox.com/showthread.php?t=57002)

Larryz April 23rd, 2007 09:29 AM

what is asp.net
 
i am trying to do my mcad, with c#.....

i am confused i know the c# and j# for example can be used
to created websites with extensions aspx...

But what is asp.net...

c# can produce windows apps, so is not tied to .net.....

asp:button is that .net, i know there is more to it than this...

but i am trying to break it down into asp languages and what the other
bit is i am unsure..

Larry


dparsons April 23rd, 2007 08:24 PM

ASP.NET is the predecessor to the outdated ASP 3.0 Scripting language.

Where ASP was an interepeted language and *everything* was an object, asp.net is a compiled language which is much more akin to "real" programming then ASP was.

What I mean by real is having the ability to work with types and the like and not just declaring everything as an object so, to visualize:

ASP (VBScript)
Dim sValue
sValue = "This is a string"

ASP.NET (VB and C#)
Dim sValue as String = "This is a String"
string sValue = "This is a string";

So, essentially, ASP.NET is the replacement for ASP and as such it does not require the user to have the .NET framework installed on their machine, it simply must be installed on the server and IIS must be configured to execute aspx files.

By default, if IIS is already installed when you go to install the framework this will be done automatically but, if the framework is installed before iis you need to run a command prompt (start --> run --> cmd) navigate to the .NET folder (typically %systemdrive%\windows\microsoft.net\framework\[version]) once there execute aspnet_regiis -i which will configure IIS to execute aspx pages.

This line I don't understand: "c# can produce windows apps, so is not tied to .net....."

So I am not sure if you mean to imply that C# is not tied to ASP.NET or that ASP.NET is not tied to the .NET Framework?? But, in any case, C# can be used to develop windows apps, WindowCE apps, Web Services, asp.net applications, etc. (The same goes for VB.NET or J#)

<asp:Button id="btn" runat=server /> is ASP.NET and when placed on a Web Form it will render an plain old HTML button at run time and, you are correct, there is much more to it then this but its really outside the scope of one thread to break it all down. (Wrox has numerous books on this subject that you might want to check out)

hth^^

================================================== =========
Read this if you want to know how to get a correct reply for your question:
http://www.catb.org/~esr/faqs/smart-questions.html
================================================== =========
Technical Editor for: Professional Search Engine Optimization with ASP.NET
http://www.wiley.com/WileyCDA/WileyT...470131470.html
================================================== =========
Why can't Programmers, program??
http://www.codinghorror.com/blog/archives/000781.html
================================================== =========

Larryz April 24th, 2007 07:53 PM

Thanks that was a good explanation...... But...
I was wondering by learnng visual c#, which can be used to develope asp.net applications..... Are you learning asp.net and c# or bits of both..

i am trying to understand ok i can learn language, but what bits of it make it asp.net and what bits make it just part of the language....

for example int i; that could be used in an asp.net application... it doesnt do much but you can be sure that some integers will be declared in most application... windows or otherwise....

What i mean is c# is not asp.net... nor is vb6..... so what is it..

Larry...


dparsons April 24th, 2007 09:19 PM

Ok. C# is a language (as is VB, J# etc) all that that is is a bunch of Syntax that when executed inside of the .NET framework does some task.

ASP.NET on the other hand is a TECHNOLOGY that allows us to do different things on the web that simply are possible with HTML, DHTML, etc. By learning visual C# you are learning visual C# and the book will dictate in what context you are learning it (Platform Based vs Web Based) but once you know C# there are only slight difference's between writing a windows app and an ASP.NET app.

For example, you can't try to spawn a form from the the System.Windows.Forms Assembly in an ASP.NET application.

hth.

================================================== =========
Read this if you want to know how to get a correct reply for your question:
http://www.catb.org/~esr/faqs/smart-questions.html
================================================== =========
Technical Editor for: Professional Search Engine Optimization with ASP.NET
http://www.wiley.com/WileyCDA/WileyT...470131470.html
================================================== =========
Why can't Programmers, program??
http://www.codinghorror.com/blog/archives/000781.html
================================================== =========

Larryz April 25th, 2007 07:46 AM

thats great... i was stuck on that for a while cheers.. I guess its self evident really, due to books on c# and asp.net, the same title with vb, etc.. Asp being the constant.

thanks a lot...

i wonder if i may as you a few more questions.

What is a interface in terms of oop..... i have just started and having problems with all this. i have worked out what a class is, and done some coding but cant figure out this interface thing..... its just as abstract as some of the other terminology at the moment....

thanks for all your help

Larry


dparsons April 25th, 2007 08:17 AM

This is a good read in understanding Interfaces.
http://www.c-sharpcorner.com/UploadF...7-54717ef3b345

================================================== =========
Read this if you want to know how to get a correct reply for your question:
http://www.catb.org/~esr/faqs/smart-questions.html
================================================== =========
Technical Editor for: Professional Search Engine Optimization with ASP.NET
http://www.wiley.com/WileyCDA/WileyT...470131470.html
================================================== =========
Why can't Programmers, program??
http://www.codinghorror.com/blog/archives/000781.html
================================================== =========

Larryz May 3rd, 2007 04:16 AM

Its seems that when you create a new object of your own design
certain methods seems to be defined automatically for it....

ToString() for example...

This is confusing, for me at least..

You can do things like myObject.ToString();

What is this doing...

why do you want to do that

i mean if you have an object, which is an instance of a class
this is odd..

why say for example myObject.Name, here you force the object to
return the Name field using the get { return name }, for example.

or you can call other defined publicly available methods. which you define and implement...

So why then allow myObject.ToString() although not implemented in object... it doesnt make sense to me... myObject.ToString() its like trying to convert the entire thing to a string.. and for what purpose..

Also the books says abstract classes cant be instantiated but
what does that mean.... I thought it meant you cant create an instance of it...but only derive from it... but you are partly creating and instance of it when you store fields values in it.... via a derived object.

Larry confused again , no change there then.. :)


dparsons May 3rd, 2007 06:48 AM

hmm. About your class, are you deriving it from another class? Because, given this code:

using System;
using System.Collections.Generic;

namespace foo
{
    class foo
    {
    
    }
}

The only properties that I can access through something like

{
foo.[property]
}

is Equals and ReferenceEquals (which determines if 2 objects are equal) BUT if i change my class to this

namespace foo
{
    class foo
    {
        public static string fooString()
        {

        }
    }
}

I can do

foo.fooString().ToString(); (This is obviously pointless since fooString returns a string but, at this point, you are accessing all of the properties of the string type since that is what the function returns)

I hope that helps you.

Abstract Classes, as you said, can not be instantiated they MUST be inherited. By inheriting from an abstract class you are not instantating it but doing this:

MyClass foo = new MyClass();

Where MyClass is marked as abstract, this line of code will throw an error since are you explicitly instantiating the object with the intent to work with it directly as opposed to inherting from it.

hth.

================================================== =========
Read this if you want to know how to get a correct reply for your question:
http://www.catb.org/~esr/faqs/smart-questions.html
================================================== =========
Technical Editor for: Professional Search Engine Optimization with ASP.NET
http://www.wiley.com/WileyCDA/WileyT...470131470.html
================================================== =========
Why can't Programmers, program??
http://www.codinghorror.com/blog/archives/000781.html
================================================== =========

Larryz May 3rd, 2007 10:26 AM

So when you create a basic class,
For example
namespace mynamespace
{
public class myClass
{
 public string Name;
get
}
return name;
}
set
{

name = value;
}
public myClass()
{
//default constructor
}
public myClass(string objName)
{

}
}


here no methods have been defined, purposely....

Later we can try in console application....

class Program
{
static void Main(string[] args)
{
 myClass myObj = new myClass("Fred");
myClass.ToString();
// is possible because of inheritance ???????

}
}
}


}


dparsons May 3rd, 2007 11:00 AM

I am sorry, no. I misunderstood you. In my example I was referencing the static properties of my foo object in the above code.

When You create an instance of an object and then call the .ToString() method, what this does is it gives you a human readable string of what the object is.

For example doing:
Object o = new Object();
Console.WriteLine(o.ToString());

Will print out System.Object.

On the flip side:
int i = 0;
Console.WriteLine(i.ToString());

will return 0.

In your example above, calling .ToString should return: mynamespace.myClass

================================================== =========
Read this if you want to know how to get a correct reply for your question:
http://www.catb.org/~esr/faqs/smart-questions.html
================================================== =========
Technical Editor for: Professional Search Engine Optimization with ASP.NET
http://www.wiley.com/WileyCDA/WileyT...470131470.html
================================================== =========
Why can't Programmers, program??
http://www.codinghorror.com/blog/archives/000781.html
================================================== =========


All times are GMT -4. The time now is 07:19 PM.

Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.