Just installed Visual Cobol and was working through the course to learn to use it. When I got to the WebDemo program I get the error Message that says "Make sure that the class defined in this code file matches the "inherits" attribute, and that Default.aspx.cbl it extends the correct base class (e.g. Page or UserControl)." So to see what the issue was I created a blank one, much to my surprise I received the same results. I am using Visual Studio 2012 and the latest Visual Cobol Personal Edition. Any help would be appreciated.
Below is the code
class-id _Default is partial
inherits type System.Web.UI.Page.
working-storage section.
method-id Page_Load protected.
local-storage section.
procedure division using by value param-sender as object
param-e as type System.EventArgs.
goback.
end method.
method-id btnOK_Click protected.
01 name-entered pic x(20).
01 response pic x(20).
procedure division using by value lnkSender as object lnkEvent as type System.EventArgs.
move txtName::Text to name-entered
string "Hello " delimited by size
name-entered delimited by space
into response
move response to lblResponse::Text
.
end method.
end class.
Below is the Default.aspx
<%@ Import Namespace="System.Web.UI.Page" %>
<%@ Page Language="COBOL" AutoEventWireup="true" CodeFile="Default.aspx.cbl" Inherits="_Default" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<title>Untitled Page</title>
</head>
<body>
<form id="form1" runat="server">
<div id="MyForm">
<asp:Label ID="lblIntro" runat="server"
Text="Please enter your name and press OK"></asp:Label>
<asp:TextBox ID="txtName" runat="server"></asp:TextBox>
<br />
<br />
<br />
<asp:Button ID="btnOK" runat="server" onclick="btnOK_Click" Text="OK" />
<asp:Label ID="lblResponse" runat="server" ForeColor="Red"></asp:Label>
</div>
</form>
</body>
</html>