Sideway
output.to from Sideway
Draft for Information Only

Content

Scripting
  ASP.NET Server-Side Scripting
  Examples
  Scripting Language
   Visual Basic .NET
  Visual C# .NET
  Visual C++ .NET
  Managed Extensions for C++
  Transact-SQL
  Windows Script Host
  VBScript
  JScript
  JScript .NET
  Extensible Markup Language (XML)
  Visual J++
  Alternative Languages
  Source/Reference

Scripting

ASP.NET is only a server side scripting technology along with some fundamental interface elements from Microsoft.com for running script on the server side to create HTML content dynamically. In other words, ASP.NET is only a scripting host for the supported scripting language to provide the interactivity required for a dynamic web application solution on the server side. Script is a small program or a series of instructions written for a command interpreter to interact with the scripting host. A scripting language is needed to use as the programming language for web application development. The scripting language allows the web site builder to customization their web site by making use of the conditional and looping statements, and the built-in functions.

ASP.NET Server-Side Scripting

For the client-side scripting,  all script can be placed within the HTML document by the <script> element. That is all script is enclosed by <script></script> tags of the <script> element. The included scripting code in the HTML document will sent to the browser together with the HTML contents. But for the ASP server-side scripting, the file extension of the HTML document should be ended with ".aspx" and all ASP.NET command must be delimited with <%...%> otherwise the ASP.NET code or scripts will not be compiled by the ASP.NET engine. Since the code delimited with <%...%> will be interpred before sending to the browser, the server-side script which compatible with the client-side scripting language can also be placed inside the client-side script. Besides the <script> element with "runat" attribute equal to "server" can also be interpreted as a server-side only function which can be work with the ASP.NET script at the server-side. However, since the server-side <script> element is already running in the server-side scripting environment, the using of delimiters <%...%> in the server-side <script> element will become a syntax error.  Therefore the delimiter "<%" is to pass the control of code interpretation to the ASP.NET engine of the current default scripting and the delimiter "%>" is to return the control of code interpretation to the web server.

Examples

Examples of ASP.NET code
ASP.NET Code Input:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
    <head>
        <title>Sample Page</title>
        <meta http-equiv="Content-Type" content="text/html;charset=utf-8">
    </head>
    <body>
<%Response . Write("<p>Results on "& Request.ServerVariables("SERVER_SOFTWARE") & " .net: " & System.Environment.Version.ToString & " " & ScriptEngine & " Version " & ScriptEngineMajorVersion & "." & ScriptEngineMinorVersion & "</p>")%>
<%Dim strName = "ABCDE" : Dim intCount = 3%>
Cut "<%=strName%>" to "<%=strCutName(strName)%>".
<script language = "vbscript" runat = "server">
function strCutName(strName)
strCutName = Right(strName, 3)
end function
</script>
<script type = "text/javascript">
var str = "<%=strName%>"; document.write(str.slice(2));
</script> 

    </body>
</html>
HTTP Response Output:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
    <head>
        <title>Sample Page</title>
        <meta http-equiv="Content-Type" content="text/html;charset=utf-8">
    </head>
    <body>
<p>Results on Microsoft-IIS/8.5 .net: 4.0.30319.42000 VB Version 14.0</p>
Cut "ABCDE" to "CDE".

<script type = "text/javascript">
var str = "ABCDE"; document.write(str.slice(2));
</script> 

    </body>
</html>
HTML Web Page Embedded Output:

Scripting Language

In general, the five common compilers that support or were built for the common language runtime (CLR) in the .NET Framework are

  • Visual Basic .NET language
  • Visual C# .NET language
  • Visual J# .NET language
  • Visual C++ .NET language
  • JScript .NET language

However, by making use of the .NET framework services and features through a common set of unified classes, many .NET platform programming languages are supported.

Visual Basic .NET

Visual Basic .NET is the next generation of the Visual Basic language from Microsoft. Visual Basic provides prototypes of some common project types, including:

  • Windows Application.
  • Class Library.
  • Windows Control Library.
  • ASP.NET Web Application.
  • ASP.NET Web Service.
  • Web Control Library.
  • Console Application.
  • Windows Service.

Visual C# .NET

Visual C# (pronounced C sharp) is designed to be a fast and easy way to create .NET applications, including Web services and ASP.NET Web applications. C# is a simple, elegant, type-safe, object-oriented language recently developed by Microsoft for building a wide range of applications. Visual C# provides prototypes of some common project types, including:

  • Windows Application.
  • Class Library.
  • Windows Control Library.
  • ASP.NET Web Application.
  • ASP.NET Web Service.
  • Web Control Library.
  • Console Application.
  • Windows Service.

Visual C++ .NET

Visual C++ .NET is the next generation of the Visual C++ language from Microsoft. 

Visual C++ provides prototypes of some common project types, including:

  • Active Template Library (ATL) Project.
  • ATL Server Project.
  • ATL Server Web Service.
  • Custom Wizard.
  • Extended Stored Procedure DLL.
  • Makefile Project.
  • ASP.NET Web Service
  • Class Library (.NET)
  • Console Application (.NET)
  • Windows Control Library (.NET)
  • Windows Forms Application (.NET)
  • Windows Service (.NET)
  • Microsoft Foundation Classes (MFC) ActiveX Control.
  • MFC Application.
  • MFC DLL.
  • MFC ISAPI Extension DLL.
  • Win32 Project.

Managed Extensions for C++

Managed Extensions for C++ also provide a simple way to integrate existing applications into the .NET Framework. When using Managed Extensions for C++, the benefits of the support and services provided by the common language runtime (such as memory management, cross-language integration, code access security, and automatic lifetime control of objects)  can be achieved.

Transact-SQL

Transact-SQL is the native language for storing, modifying, and retrieving information in Microsoft SQL Server relational databases. Transact-SQL can be used to create databases and any of the objects stored in a database, such as tables, columns, triggers, keys, indexes, views, stored procedures, and functions. Transact-SQL is fully supported in the Visual Studio editor and in the designers provided with Visual Database Tools. Besides, Visual Database Tools can also connect to an Oracle database.

Windows Script Host

Windows Script Host (WSH) is a language-independent scripting environment for 32-bit Windows platforms. With WSH, Microsoft offers VBScript, JScript, and JScript .NET scripting engines. These scripting languages can be used in the ASP pages of a Web server, in HTML pages that run in Internet Explorer, and in Windows Script Host scripting engines on Windows 98 and Windows 2000.

WSH can automate administrative tasks on a server, using any scripting language. For example, an administrator can write VBScript to create a new virtual directory and then, with WSH working in the background, run the script file from the command line to create a new virtual directory on the Web site. In addition, administrators can write a single script to target multiple Web sites or multiple physical servers.

Third-party companies supply ActiveX scripting engines for other languages such as Perl, TCL, REXX, and Python.

VBScript

Microsoft Visual Basic Scripting Edition (VBScript) is a subset of Microsoft Visual Basic — it will look very familiar to you if you have ever used Visual Basic. It is not identical, however. Because VBScript is specifically designed to work in Internet Explorer (IE) browsers, it does not include features that are normally outside the scope of scripting, such as file access and printing. However, it is common to use the FileSystem Object with VBScript to manipulate files.

VBScript brings active scripting to a wide variety of environments, including Web client scripting in IE, and Web server scripting in Microsoft Internet Information Services (IIS), Microsoft Internet Security and Acceleration Server (ISA), and Sun Solaris. VBScript is a fast, portable, interpreted, object-based scripting language that processes source code embedded directly in HTML pages. You can use VBScript to add intelligence and interactivity to WSH, ASP, and HTML pages.

Like JScript, VBScript talks to host applications using Windows Script. With Windows Script, browsers and other host applications do not require special integration code for each scripting component. Windows Script enables a host to compile scripts, obtain and call entry points, and manage the namespace available to the developer.

VBScript is a loosely typed language. Loosely typed means you do not have to declare the data types of variables explicitly. In fact, you cannot explicitly declare data types in VBScript. Moreover, in many cases VBScript performs conversions automatically when needed. For instance, if you add a number to an item consisting of text (a string), the number is converted to text.

JScript

Microsoft JScript is designed for Web page scripting. JScript conforms to the ECMA 262 language specification. JScript is a powerful scripting language specifically targeted at the Internet. Like VBScript, JScript is an interpreted, object-based scripting language that processes source code embedded directly in HTML pages. JScript runs on both Internet Explorer and Netscape browsers.

Like VBScript, JScript talks to host applications using Windows Script Host. With Windows Script Host, browsers and other host applications do not require special integration code for each scripting component. Windows Script Host enables a host to compile scripts, obtain and call entry points, and manage the namespace available to the developer.

JScript is a loosely typed language. Loosely typed means you do not have to declare the data types of variables explicitly. In fact, you cannot explicitly declare data types in JScript. Moreover, in many cases JScript performs conversions automatically when needed. For instance, if you add a number to an item consisting of text (a string), the number is converted to text.

JScript .NET

JScript .NET is the next generation of Microsoft's implementation of the ECMA 262 language, developed in conjunction with ECMAScript Edition 4. It is designed to run within the common language runtime to manage the execution of code and provide services that make the development process easier. With JScript .NET you get features such as cross-language integration, cross-language exception handling, enhanced security, versioning and deployment support, a simplified model for component interaction, and debugging and profiling services.

Combining the existing feature set of classic JScript (it is fully backward compatible) with the common language runtime and the best features of class-based languages, JScript .NET gives you the best of all worlds. Improvements in JScript .NET include true compiled code, typed and typeless variables, classes (with inheritance, function overloading, property accessors, and more), packages, cross-language support, and access to the .NET Framework.

Extensible Markup Language (XML)

XML provides a format for describing structured data that allows for precise declarations of content and useful search results across multiple platforms. XML defines information and data according to purpose rather than presentation so that several applications can use the information and data in ways that promote diverse application reuse and extensibility. XML is an increasingly important meta-markup language that is convenient for use on the Internet.

It is important to realize that the various members of Windows Server System support XML as a data exchange format. For example, the SQL XML feature of SQL Server 2000 makes it possible for .NET applications to get their database query results as XML documents instead of relational result sets. As an important technology in the .NET Platform, XML is enabling a new generation of client and provider Web-based services.

XML is not a replacement for HTML. Although both are markup languages, they function in a complementary manner. The strength of HTML is in displaying information whereas XML is an excellent way to describe information. XML's strength lies partly in its ability to separate the user interface from data being displayed, thus allowing the cross-platform performance noted earlier.

In distributed application architecture, XML messaging allows data to easily move through firewalls and between heterogeneous systems using standard transport mechanisms. Whatever your application requires — importing, exporting, data interchange, interoperability with other applications (such as Office 2000 or Exchange 2000), parsing, modifying, data access, data storage — XML is an easily used data exchange format. Visual Studio .NET provides some great tools for working with XML and your favorite programming language.

Visual J++

Microsoft provides the Java User Migration Path to Microsoft .NET (JUMP to .NET) as a set of technologies and services that enable programmers to preserve, enhance, and migrate Java language projects onto the Microsoft .NET Platform. With JUMP to .NET you can continue to take advantage of existing Visual J++ skills and source code while extending your application and components onto the .NET Platform. If you are familiar with the Visual J++ language, you can use it to create new .NET applications or easily migrate existing code to the new C# language using automated migration tools.

Alternative Languages

Microsoft partners with many companies to bring their languages to the .NET Platform. In addition to the languages provided by Microsoft, there are many alternative languages that target the .NET Platform, including:

  • COBOL for Microsoft .NET.
  • Perl for Microsoft .NET.
  • Eiffel for Microsoft .NET.
  • Python for Microsoft .NET.
  • Pascal for Microsoft .NET.
  • Mercury for Microsoft .NET.
  • Mondrian for Microsoft .NET.
  • Oberon for Microsoft .NET.
  • Salford FTN95 (Fortran) for Microsoft .NET.
  • SmallTalk for Microsoft .NET.
  • Standard ML for Microsoft .NET.
  • Dyalog APL for Microsoft .NET.

Source/Reference

  • https://msdn.microsoft.com/en-us/data/aa292164(v=vs.85)
  • https://docs.microsoft.com/en-us/previous-versions/ms229699(%3dvs.80)

©sideway

ID: 190500016 Last Updated: 5/16/2019 Revision: 0 Ref:

close

References

  1. Active Server Pages,  , http://msdn.microsoft.com/en-us/library/aa286483.aspx
  2. ASP Overview,  , http://msdn.microsoft.com/en-us/library/ms524929%28v=vs.90%29.aspx
  3. ASP Best Practices,  , http://technet.microsoft.com/en-us/library/cc939157.aspx
  4. ASP Built-in Objects,  , http://msdn.microsoft.com/en-us/library/ie/ms524716(v=vs.90).aspx
  5. Response Object,  , http://msdn.microsoft.com/en-us/library/ms525405(v=vs.90).aspx
  6. Request Object,  , http://msdn.microsoft.com/en-us/library/ms524948(v=vs.90).aspx
  7. Server Object (IIS),  , http://msdn.microsoft.com/en-us/library/ms525541(v=vs.90).aspx
  8. Application Object (IIS),  , http://msdn.microsoft.com/en-us/library/ms525360(v=vs.90).aspx
  9. Session Object (IIS),  , http://msdn.microsoft.com/en-us/library/ms524319(8v=vs.90).aspx
  10. ASPError Object,  , http://msdn.microsoft.com/en-us/library/ms524942(v=vs.90).aspx
  11. ObjectContext Object (IIS),  , http://msdn.microsoft.com/en-us/library/ms525667(v=vs.90).aspx
  12. Debugging Global.asa Files,  , http://msdn.microsoft.com/en-us/library/aa291249(v=vs.71).aspx
  13. How to: Debug Global.asa files,  , http://msdn.microsoft.com/en-us/library/ms241868(v=vs.80).aspx
  14. Calling COM Components from ASP Pages,  , http://msdn.microsoft.com/en-us/library/ms524620(v=VS.90).aspx
  15. IIS ASP Scripting Reference,  , http://msdn.microsoft.com/en-us/library/ms524664(v=vs.90).aspx
  16. ASP Keywords,  , http://msdn.microsoft.com/en-us/library/ms524672(v=vs.90).aspx
  17. Creating Simple ASP Pages,  , http://msdn.microsoft.com/en-us/library/ms524741(v=vs.90).aspx
  18. Including Files in ASP Applications,  , http://msdn.microsoft.com/en-us/library/ms524876(v=vs.90).aspx
  19. ASP Overview,  , http://msdn.microsoft.com/en-us/library/ms524929(v=vs.90).aspx
  20. FileSystemObject Object,  , http://msdn.microsoft.com/en-us/library/z9ty6h50(v=vs.84).aspx
  21. http://msdn.microsoft.com/en-us/library/windows/desktop/ms675944(v=vs.85).aspx,  , ADO Object Model
  22. ADO Fundamentals,  , http://msdn.microsoft.com/en-us/library/windows/desktop/ms680928(v=vs.85).aspx
close

Latest Updated LinksValid XHTML 1.0 Transitional Valid CSS!Nu Html Checker Firefox53 Chromena IExplorerna
IMAGE

Home 5

Business

Management

HBR 3

Information

Recreation

Hobbies 8

Culture

Chinese 1097

English 339

Reference 79

Computer

Hardware 249

Software

Application 213

Digitization 32

Latex 52

Manim 205

KB 1

Numeric 19

Programming

Web 289

Unicode 504

HTML 66

CSS 65

SVG 46

ASP.NET 270

OS 429

DeskTop 7

Python 72

Knowledge

Mathematics

Formulas 8

Algebra 84

Number Theory 206

Trigonometry 31

Geometry 34

Coordinate Geometry 2

Calculus 67

Complex Analysis 21

Engineering

Tables 8

Mechanical

Mechanics 1

Rigid Bodies

Statics 92

Dynamics 37

Fluid 5

Fluid Kinematics 5

Control

Process Control 1

Acoustics 19

FiniteElement 2

Natural Sciences

Matter 1

Electric 27

Biology 1

Geography 1


Copyright © 2000-2024 Sideway . All rights reserved Disclaimers last modified on 06 September 2019