Skip to main content

Getting Started with Visual COBOL for Visual Studio

Creating Web Applications

Summary

In this tutorial, we task you through the steps to create an ASP.NET web application.

Start Visual Studio and from the file menu, create a new project.

Under the COBOL templates and select Web and ASP.NET Web Application.

Give the project a name and location and click OK

Click the design tab in the bottom left of the main window to switch to the HTML design view.

Ensure the toolbox window is visible from the View menu

And then drag a button from the toolbox on to the form.

Add a textbox too.

Your screen should look similar to this:

Double-click the button to add an event handler.

Add the following code:

class-id WebApplication1._Default is partial
inherits type System.Web.UI.Page public.
working-storage section.

method-id Page_Load protected.
local-storage section.
procedure division using by value sender as object by value e as type EventArgs.

goback.
end method.

method-id Button1_Click protected.
procedure division using by value sender as object e as type System.EventArgs.

set TextBox1::Text to "hello world!"

end method.

end class.

In the solution explorer window, right-click default.aspx and select "set as start page"

Press F5 to build and run your application.

Using JQuery and Web Services

Take this a step further by downloading the project here which shows how to use JQuery and web services to produce rich applications for mobile devices.


#HowTo-BestPractice