Presentation is loading. Please wait.

Presentation is loading. Please wait.

Cross-Language Demo Demonstrates mixing C# and VB.NET code C# Class CSDemoClass.cs VB.NET Class VBDemoClass.vb “Main” class (C#) Demo.cs.

Similar presentations


Presentation on theme: "Cross-Language Demo Demonstrates mixing C# and VB.NET code C# Class CSDemoClass.cs VB.NET Class VBDemoClass.vb “Main” class (C#) Demo.cs."— Presentation transcript:

1 Cross-Language Demo Demonstrates mixing C# and VB.NET code C# Class CSDemoClass.cs VB.NET Class VBDemoClass.vb “Main” class (C#) Demo.cs

2 CSDemoClass.cs using System; namespace CSDemo { public class CSDemoClass { … protected String getDateTime(){ return DateTime.Now.ToString(); }

3 VBDemoClass.vb Public Class VBDemoClass Public Sub ShowTime(ByVal time as String) MsgBox(time, MsgBoxStyle.Information, “VB MsgBox”) End Sub End Class

4 Demo.cs using System; using CSDemo; using VBDemo; namespace Demo { class Demo { static void Main(string[] args) { String date; CSDemoClass csApp = new CSDemoClass(); VBDemoClass vbApp = new VBDemoClass(); date = csApp.getTime(); vbApp.ShowTime(date); }

5 Cross-Language Example

6 Using.NET Jiunwei Chen

7 ASP.NET Evolution of ASP (Active Server Pages) Traditional web scripting language Features Use any.NET language (C#, VB, COBOL, etc) Compiled and executed in native machine code Allows for code-behind Objected-oriented web development environment Web Forms and Web Services

8 Network Managed Process ASP.NET Hosting the.NET Framework CLR Web form and custom application objects Request and post-back form information HTML representation of application UI Web Server Browser-Client ASP.NET in Context

9 Code Behind Separation of the HTML and the code Markup resides in an.ASPX file Code lies in a C# (.CS) file or managed assembly (.DLL) ASP.NET Class is derived from System.Web.UI.Page HTML is generated and sent to the browser

10 Time.aspx <% @Page Language="C#" Inherits=“TimePage" Src=“Time.cs" %> Time Page The time is

11 Time.cs using System; using System.Web.UI; public class TimePage:Page{ protected void OutputTime(){ Response.Write( DateTime.Now.ToString(“T")); }

12 Time Example

13 Web Forms Core of ASP.NET Separates interface from code logic (View / Model) ASP.NET detects browser and chooses rendering Server-side controls Can use visual tools to layout controls Similar to VB, JavaBeans, WebObjects

14 WebControls.aspx...... <asp:Calendar id="calendar" runat="server"> <asp:Button id="button" Text=“Submit" runat="server">...

15 Web Controls Example

16 XML Web Services Small, re-usable application components shared over the Web as services XML data representation HTTP transport protocol SOAP (Simple Object Access Protocol) RPC (Remote Procedure Call) standard

17 Network Managed Process ASP.NET Hosting the.NET Framework CLR XML Web Service objects SOAP Method Request SOAP Method Response Web Server Service-Client XML Web Services

18 Why use XML Web Services? Faster Development Use any.NET language XML naturally separates data from view “.NET My Services” provides core functions (user authentication, etc.) Greater Reliability Harness all the benefits of the CLR Integration Built off XML and SOAP

19 References Clark, Jason,.NET Tutorials, 2001 (Accessible at www.devhood.com)www.devhood.com Microsoft Corporation, Microsoft.NET, http://www.microsoft.com/net/, 2002 http://www.microsoft.com/net/


Download ppt "Cross-Language Demo Demonstrates mixing C# and VB.NET code C# Class CSDemoClass.cs VB.NET Class VBDemoClass.vb “Main” class (C#) Demo.cs."

Similar presentations


Ads by Google