Script# - the.NET response to Google Web Toolkit Gojko Adzic

Slides:



Advertisements
Similar presentations
Web Toolkit Julie George & Ronald Lopez 1. Requirements  Java SDK version 1.5 or later  Apache Ant is also necessary to run command line arguments 
Advertisements

LH SharePoint SIG - Custom Actions. Custom Actions A custom action represents a Server ribbon, menu, or link customization that a user can see. Custom.
1 Visual Studio Enhancements. 2 Integrated Ajax Support Don’t need an Ajax-Enabled Template Automatic Extender Detection Add Extender Wizard.
DEV392: Extending SharePoint Products And Technologies Through Web Parts And ASP.NET Clint Covington, Program Manager Data And Developer Services - Office.
Microsoft ASP.NET AJAX - AJAX as it has to be Presented by : Rana Vijayasimha Nalla CSCE Grad Student.
Inline, Internal, and External FIle
Tutorial -01. Objective In this session we will discuss about : 1.What is MVC? 2.Why MVC? 3.Advantages of MVC over ASP.NET 4.ASP.NET development models.
1 Using jQuery JavaScript & jQuery the missing manual (Second Edition)
XML on the Web: is it still relevant? O'Neil D. Delpratt.
JavaScript CMPT 281. Outline Introduction to JavaScript Resources What is JavaScript? JavaScript in web pages.
McGraw-Hill© 2007 The McGraw-Hill Companies, Inc. All rights reserved. 1-1.
Tutorial: Introduction to ASP.NET Internet Technologies and Web Application 4 th February 2010.
JavaScript & jQuery the missing manual Chapter 11
Philly.NET Hands-on Labs JAVASCRIPT SERIES. July 9: JavaScript Syntax Visual Studio ◦Projects ◦Editors ◦Debugging ◦Script blocks ◦Minification and bundling.
ASP.NET 5 Visual Studio 2015 Templates Bill Wolff Rob Keiser June 10, 2015.
JavaScript Teppo Räisänen LIIKE/OAMK HTML, CSS, JavaScript HTML defines the structure CSS defines the layout JavaScript is used for scripting It.
ASP.NET + Ajax Jesper Tørresø ITNET2 F08. Ajax Ajax (Asynchronous JavaScript and XML) A group of interrelated web development techniques used for creating.
AJAX in ASP.NET James Crowley Developer Fusion
Sofia, Bulgaria | 9-10 October Large-Scale Client Script Development in ASP.NET "Atlas“ Tools, Tips, And Techniques Hristo Deshev telerik Hristo Deshev.
Introduction to ArcGIS API for JavaScript
Lesley Bross, August 29, 2010 ArcGIS 10 add-in glossary.
JavaScript Defined DOM (Document Object Model) General Syntax Body vs. Head Variables Math & Logic Selection Functions & Events Loops Animation Getting.
Bridges To Computing General Information: This document was created for use in the "Bridges to Computing" project of Brooklyn College. You are invited.
Javascript. Outline Introduction Fundamental of JavaScript Javascript events management DOM and Dynamic HTML (DHTML)
‘Tirgul’ # 7 Enterprise Development Using Visual Basic 6.0 Autumn 2002 Tirgul #7.
ASP.NET application. Roadmap ASP.NET file types Bin directory Application updates Simple application from start to finish using a virtual directory Behind.
The Web Architecture and ASP.NET. Slide 2 Review of the Web (1) It began with HTTP and HTML, which delivers static Web pages to browsers which would render.
Client Side Programming with JavaScript Why use client side programming? Web sides built on CGI programs can rapidly become overly complicated to maintain,
CO1552 Web Application Development HTML Forms, Events and an introduction to JavaScript.
Sponsors Gold Silver Bronze Custom REST services and jQuery AJAX Building your own custom REST services and consuming them with jQuery AJAX.
DHTML AND JAVASCRIPT Genetic Computer School LESSON 5 INTRODUCTION JAVASCRIPT G H E F.
Module 3: Working with Components. Overview An Introduction to Key.NET Framework Development Technologies Creating a Simple.NET Framework Component Creating.
Introducing ASP.NET 2.0. Internet Technologies WWW Architecture Web Server Client Server Request Response Network HTTP TCP/IP PC/Mac/Unix + Browser (IE,
JavaScript, jQuery, and Mashups Incorporating JavaScript, jQuery, and other Mashups into existing pages.
Sponsors Gold Silver Bronze Custom REST services and jQuery AJAX Building your own custom REST services and consuming them with jQuery AJAX.
Developing AJAX Web applications with Castle Monorail David De Florinier Gojko Adzic Skills Matter 12/06/08.
.  A multi layer architecture powered by Spring Framework, ExtJS, Spring Security and Hibernate.  Taken advantage of Spring’s multi layer injection.
Fundamentals, Ajax, Templates, UI Doncho Minkov Telerik Corporation
Christopher M. Pascucci.NET Programming CodeBehind.
Unleash the Power of jQuery Learning & Development Team Telerik Software Academy.
JQuery JavaScript is a powerful language but it is not always easy to work with. jQuery is a JavaScript library that helps with: – HTML document traversal.
Trunica Inc. 500 East Kennedy Blvd #300 Tampa, FL Cross Platform Mobile Apps With Cordova and Visual Studio 2015 © Copyright 2015.
WorldWide Telescope WWT HTML5 SDK WEB CONTROL WEB CLIENT DEVELOPMENT OVERVIEW RON GILCHRIST (WEB ON GITHUB NOV 7, 2015.
Introduction to Object-Oriented Programming Lesson 2.
JavaScript Defined DOM (Document Object Model) General Syntax Body vs. Head Variables Math & Logic Selection Functions & Events Loops Animation Getting.
Unit-IV - Flash Player - Flex framework - MXML introduction - Action script introduction - Working with Action script - Flex data binding - Common UI components.
Creating Web Documents: JavaScript Ftp / file management: review Introduction to JavaScript Sources Homework: start review for midterm, work on Project.
Rich Internet Applications 2. Core JavaScript. The importance of JavaScript Many choices open to the developer for server-side Can choose server technology.
UNDERSTANDING YOUR OPTIONS FOR CLIENT-SIDE DEVELOPMENT IN OFFICE 365 Mark Rackley
SHAREPOINT & JQUERY. Hi, my name and I am a product manager at lightning tools. I have been working with SharePoint for 5 years.
Virtual techdays INDIA │ 9-11 February 2011 SESSION TITLE Kamala Rajan S │ Technical Manager, Marlabs.
Introduction to JavaScript MIS 3502, Spring 2016 Jeremy Shafer Department of MIS Fox School of Business Temple University 2/2/2016.
AJAX CS456 Fall Examples Where is AJAX used? Why do we care?
ASP.Net ICallback Vijayalakshmi G M Senior Trainer Binary Spectrum.
CGS 3066: Web Programming and Design Spring 2016 Introduction to JavaScript.
Wes Preston DEV 202. Audience: Info Workers, Dev A deeper dive into use-cases where client-side rendering (CSR) and SharePoint’s JS Link property can.
1 Using jQuery JavaScript & jQuery the missing manual (Second Edition)
The Microsoft Technical Roadshow 2007 AJAX Development Mike Ormond Developer & Platform Group Microsoft Ltd
Google Web Toolkit Tutorial
Haritha Dasari Josue Balandrano Coronel -
MVC Framework, in general.
Web Development in Microsoft Visual Studio 2013
C# Event Processing Model
A second look at JavaScript
jQuery The Easy JavaScript Nikolay Chochev Technical Trainer
JQuery with ASP.NET.
JavaScript for Gadget Development
ASP.NET Module Subtitle.
How to organize and document your classes
Web Programming and Design
Presentation transcript:

Script# - the.NET response to Google Web Toolkit Gojko Adzic

Why should you care? A much more productive way to write and maintain complex JavaScript code –Compile-time consistency check –Refactoring support –Full Intellisense for DOM and your own JS classes –Lots of other VS IDE benefits Free (not opensource, though)

What Script# is not It does not hide browser complexity It does not abstract away JS peculiarities It is not a general-purpose.NET to browser converter It is not a widget/effect library (it has some, but not nearly like GWT)

Under the hood Compiles C# into JS directly Replacement for System namespace, a mashup of.NET and JS –Sscorlib.dll in C# for Intellisense, –sscorlib.js in the browser –sscompat.js provides cross-browser compatibility System.DHTML.Document, System.Script System.DHTML.Window link to the environment

A very simple example Script# library project Compile C# into javascript Execute from HTML –namespace.class used to instantiate objects If you do the web site by hand, don’t forget sscompat.js!

Visual Studio Integration Project templates for class libraries and web sites C# editor for scriptlets (has some bugs, though)

MSBuild Integration ScriptSharp target does the job for you Remember True Automatically added by the VS ScriptSharp template

Scriptlets Script# webforms components –Add Script# assembly and page control to web.config –Use main() as an entry point to the component No need to worry about script# initialisation Put all scripts into App_Scripts folder (or use a VS template to create the project)

AJAX support Add Use ScriptFX.Net.HTTPRequest for cross- browser compatible AJAX requests Supports Script transport for Cross- Domain Ajax!

Ajax/JSON private void OnOKButtonClick(object sender, EventArgs e) { Dictionary parameters = new Dictionary(); parameters["prefix"] = _prefixTextBox.Text; parameters["count"] = 5; _request = HTTPRequest.CreateRequest("CompletionList.ashx/GetItemsViaPost", HTTPVerb.POST); _request.SetContentAsJSON(parameters); _request.Invoke(new HTTPRequestCompletedCallback(OnRequestComplete), null); } private void OnRequestComplete(HTTPRequest request, object context) { if (_request == request) { string[] values = (string[])_request.Response.GetObject(); _valuesLabel.Text = values.Join(", "); }

Behaviours Declaratively attach functionality to DOM elements Taken from ASP.NET Ajax (Atlas) Popups, watermark, autocomplete, overlay etc… Not a lot of widgets, but you can use ExtJS with ExtSharp!

More advanced options FxCop code analysis Unit testing should follow soon ASP.NET Ajax instead of sscorelib Some silverlight support MSN Messenger APIs Facebook client API Sidebar Gadgets

Quirks: Namespace references Does not work: DOMElement runner= System.DHTML.Document.GetElementById( runnerElementId); Works: Using System.DHTML; DOMElement runner= Document.GetElementById(runnerElementId);

Quirks: Compilation issues VS New class wizard adds System, System.Data and System.Xml references –Script# compilation breaks as a result Does not resolve indirect module dependencies Nested namespaces not supported

Quirks: 0 and null comparisons if (something == null) and if (something == 0) compiled into if (!something) Try this: Number a = null; if (a == 0) Script.Alert("I shouldn't be seeing this???"); Number b = 0; if (b == null) Script.Alert("I shouldn't be seeing this either???");

Quirks: Scriptlets Scriptlet tag has to be inside a form tag –If not, nothing happens, but you don’t get an alert Inline Scriptlets use ScriptletArguments, pre-compiled ones use Dictionary

Quirks: Events DOMEventHandler expects void() delegate Use Window.Event.ReturnValue to return false from an event

What’s good? Working with complex JS files is much very productive VS integration MSBuild integration Basic Documentation is great

What’s not so good? Some unintuitive mismatch between C# and JS – type conversions, 0 and null… Advanced stuff not documented that well –See the samples zip in the distribution! Still not opensource

Where next?

What next? Dependency Injection with Castle – Oct 23 rd Asynchronous Enterprise Applications with NServiceBus – Nov 27 th TDD with.NET – Dec 17 th ALT.NET Community evening – Jan 13th