Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP.Net - the "Big Picture"?

Reply
Thread Tools

ASP.Net - the "Big Picture"?

 
 
Scott M.
Guest
Posts: n/a
 
      01-08-2010

"Metre Meter" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
On Jan 8, 10:46 am, "Patrice" <http://scribe-en.blogspot.com/> wrote:
> JScript is not .NET based but is a scripting language that runs inside the
> browser. Perhaps a confusion with J# ?


No; JScript- or at least something that claims to be JScript- is
supported by ASP.Net.

-No, that's incorrect. As I've mentioned, JScript is a client-side
scripting language that has no relationship with .NET whatsoever. It is
executed by the client, not the .NET CLR.

-Scott


 
Reply With Quote
 
 
 
 
Scott M.
Guest
Posts: n/a
 
      01-08-2010

"Metre Meter" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
On Jan 8, 4:49 pm, "Gregory A. Beamer"
<(E-Mail Removed)> wrote:

Perhaps I misunderstood where you're coming from. ASP.Net supports
what claims to be server-side JScript like so:-

<script language='jscript' runat='server'>
Response.Write("Hi there!");
</script>

-No, this is not ASP .NET. This is what we now call "Classic ASP". As
we've stated, JScript is not a .NET langauge in any way. You are
misunderstanding your usage of the tags here as ASP.NET. The code you show
here does not execute within the ASP .NET engine or the CLR.

-Scott


 
Reply With Quote
 
 
 
 
Metre Meter
Guest
Posts: n/a
 
      01-08-2010
On Jan 8, 10:09*pm, "Scott M." <(E-Mail Removed)> wrote:
> "Metre Meter" <(E-Mail Removed)> wrote in message
>
> news:(E-Mail Removed)...
> On Jan 8, 4:49 pm, "Gregory A. Beamer"
>
> <(E-Mail Removed)> wrote:
>
> Perhaps I misunderstood where you're coming from. ASP.Net supports
> what claims to be server-side JScript like so:-
>
> <script language='jscript' runat='server'>
> * * Response.Write("Hi there!");
> </script>
>
> -No, this is not ASP .NET. *This is what we now call "Classic ASP". *As
> we've stated, JScript is not a .NET langauge in any way. *You are
> misunderstanding your usage of the tags here as ASP.NET. *The code you show
> here does not execute within the ASP .NET engine or the CLR.
>
> -Scott


Can you please clarify what is happening here. The following code is
placed in the ASPX file "test.aspx" on the server:-

<!-- START FILE test.aspx -->
<%@page debug='true' language='jscript' %>
<script language='jscript' runat='server'>
var foo : System.Drawing.Drawing2D.ColorBlend = new
System.Drawing.Drawing2D.ColorBlend(); // .Net object created?
</script>
<%
Response.Write("Object foo is '" + foo + "'");
%>
<!-- END FILE test.aspx -->

This is executed *on the server*, resulting in the browser only ever
seeing this:-

<!-- START FILE test.aspx -->
Object foo is 'System.Drawing.Drawing2D.ColorBlend'
<!-- END FILE test.aspx -->

The class used above, System.Drawing.Drawing2D.ColorBlend is listed by
Microsoft as a .Net Framework class at:-
http://msdn.microsoft.com/en-us/libr...8VS.80%29.aspx
with example syntax given in (amongst others) JScript.

Also, there is something called "JScript .NET" (see
http://en.wikipedia.org/wiki/JScript_.NET ). With respect, you can
probably understand why I am confused(!)

- MM
 
Reply With Quote
 
Metre Meter
Guest
Posts: n/a
 
      01-08-2010
On Jan 8, 10:03*pm, "Scott M." <(E-Mail Removed)> wrote:
> I don't think you've fully gotten that anything having to do
> with ASP.NET happens at the web server and anything having to do with
> executing JScript happens at the client.


(Please see my reply to one of your other posts within this thread
with an example of JScript within a .aspx page apparently creating
a .Net object *on the server*- not within the browser- and mention of
"JScript.NET". If that isn't strictly ASP.Net by some definition, can
you please clarify. Thank you)

- MM
 
Reply With Quote
 
Scott M.
Guest
Posts: n/a
 
      01-09-2010

"Metre Meter" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
On Jan 8, 10:09 pm, "Scott M." <(E-Mail Removed)> wrote:
> "Metre Meter" <(E-Mail Removed)> wrote in message
>
> news:(E-Mail Removed)...
> On Jan 8, 4:49 pm, "Gregory A. Beamer"
>
> <(E-Mail Removed)> wrote:
>
> Perhaps I misunderstood where you're coming from. ASP.Net supports
> what claims to be server-side JScript like so:-
>
> <script language='jscript' runat='server'>
> Response.Write("Hi there!");
> </script>
>
> -No, this is not ASP .NET. This is what we now call "Classic ASP". As
> we've stated, JScript is not a .NET langauge in any way. You are
> misunderstanding your usage of the tags here as ASP.NET. The code you show
> here does not execute within the ASP .NET engine or the CLR.
>
> -Scott


Can you please clarify what is happening here. The following code is
placed in the ASPX file "test.aspx" on the server:-

<!-- START FILE test.aspx -->
<%@page debug='true' language='jscript' %>
<script language='jscript' runat='server'>
var foo : System.Drawing.Drawing2D.ColorBlend = new
System.Drawing.Drawing2D.ColorBlend(); // .Net object created?
</script>
<%
Response.Write("Object foo is '" + foo + "'");
%>
<!-- END FILE test.aspx -->

This is executed *on the server*, resulting in the browser only ever
seeing this:-

<!-- START FILE test.aspx -->
Object foo is 'System.Drawing.Drawing2D.ColorBlend'
<!-- END FILE test.aspx -->

The class used above, System.Drawing.Drawing2D.ColorBlend is listed by
Microsoft as a .Net Framework class at:-
http://msdn.microsoft.com/en-us/libr...8VS.80%29.aspx
with example syntax given in (amongst others) JScript.

Also, there is something called "JScript .NET" (see
http://en.wikipedia.org/wiki/JScript_.NET ). With respect, you can
probably understand why I am confused(!)

JScript and JScript.NET are two separate and distinct things. You are
gettting the two confused. What's happening is that you are writing Classic
ASP code, which is being executed as such, not by the CLR.

JScript.NET is not native to VS and unless you have some specific reason to
use it, you shouldn't.

-Scott


 
Reply With Quote
 
Patrice
Guest
Posts: n/a
 
      01-09-2010
This is likely JScript.NET
(http://msdn.microsoft.com/en-us/library/ms974588.aspx) that I mistakenly
named J# which is still something else. You could use the ScriptEngineXXX
function to find out what version it is...

Actually I tried here and got JScript v 8.0.50727 server side and JScript v
5.8.18795 client side so as you see this is not the same scripting engine.

Is this just because you thought it would be easier in a specific case or do
you really have all your server code in JScript.NET ?

--
Patrice

 
Reply With Quote
 
Metre Meter
Guest
Posts: n/a
 
      01-09-2010
On Jan 9, 10:37*am, "Patrice" <http://scribe-en.blogspot.com/> wrote:
> This is likely JScript.NET


Yes, that's highly probable(!)

> (http://msdn.microsoft.com/en-us/library/ms974588.aspx) that I mistakenly
> named J# which is still something else.


Yes; as far as I'm aware, J# is (essentially) a .Net language with the
same basic syntax as Java, but using the .Net framework objects and
compiling to CIL bytecode instead.

> Is this just because you thought it would be easier in a specific case or do
> you really have all your server code in JScript.NET ?


I've written one app in JScript.NET; my already minimal C# knowledge
was quite rusty at that time, I'd been using JScript (and client-side
JavaScript) at the time anyway, and it was quicker and simpler to use.
I was pretty aware that it wasn't that serious (or ".NET-ish") a
language though.

I wrote a more recent app in C# and would be more likely to use that
in future anyway.

- MM
 
Reply With Quote
 
Metre Meter
Guest
Posts: n/a
 
      01-09-2010
On Jan 9, 12:04*am, "Scott M." <(E-Mail Removed)> wrote:
> JScript and JScript.NET are two separate and distinct things. *You are
> gettting the two confused.


No. I was already aware that ASP.Net's version of JScript
(compiled, .Net-based, improved syntax) was significantly different to
the interpreted version.

I just wasn't aware that it was specifically called "JScript.Net".

Any confusion appears to come from this use of terminology. When I
referred to "jscript" in the context of ASP.Net (*), I had assumed it
would be obvious that I meant ASP.Net's version of JScript (i.e.
JScript.Net).

However, it appears that by not specifically using its official name
of "JScript.NET", it was assumed I was talking about old-school ASP
JScript. Or client-side JScript. Or something....(?!)

Hence my confusion at statements like "ASP.NET does not execute and is
not responsible for the execution of JScript"...

Since even MS seem quite happy to call it just "JScript" when the
context makes obvious that they mean JScript.NET (e.g. the JScript
declaration on this .Net documentation page:-
http://msdn.microsoft.com/en-us/libr...2d.matrix.aspx
), it's... strange that this was not picked up on.

Oh well.

> What's happening is that you are writing Classic
> ASP code


I'm not clear what you're referring to here. The "test.aspx" example
above appears to be running as an ASP.Net page and invoking a .Net
framework object within the JScript (or rather, JScript.NET) <script>
block.

If that's incorrect, can you please describe which parts- if any- of
that example are Classic ASP.

> JScript.NET is not native to VS and unless you have some specific reason to
> use it, you shouldn't.


I've used it in the past because it's convenient (and because my C#
was rusty at the time), but even then it was apparent that it wasn't a
"native" .Net language, nor the best choice for anything beyond small
projects. (Though it's still a major improvement on Classic ASP's
interpreted JScript).

I've used C# for more recent stuff.

- MM
 
Reply With Quote
 
Metre Meter
Guest
Posts: n/a
 
      01-09-2010
On Jan 9, 9:43*pm, Metre Meter <(E-Mail Removed)> wrote:
> No. I was already aware that ASP.Net's version of JScript
> (compiled, .Net-based, improved syntax) was significantly different to
> the interpreted version.


Clarification; should read "... significantly different to the
interpreted version provided by Classic ASP".

- MM
 
Reply With Quote
 
Patrice
Guest
Posts: n/a
 
      01-09-2010
Ok crystal clear now.

As you see using JScript client side is mainstream (actually JScript is MS
implementation, we should even say javascript here) as this is the defacto
scripting language for browsers but seeing someone using JScript.NET server
side is quite unusual as you can see

I failed to find a detailed comparison but FYI you may want to check :
http://en.wikipedia.org/wiki/JScript...nces_with_C.23

--
Patrice

 
Reply With Quote
 
 
 
Reply

Thread Tools

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




Advertisments