How to connect files by MVC in ASP.VBscript?

0

I am trying to connect 3 code files through MVC that are in 3 different folders (view, model and controller) and the code that is in view connects me with the controller, but the controller does not connect me with the of the model ... I tried everything but it works for me.

I leave the codes:

the view: (name: class1.asp)

<%@LANGUAGE="VBSCRIPT" CODEPAGE="1252"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1" />
<title>Documento sin t&iacute;tulo</title>
</head>

<body>

<form id="form1" name="form1" method="post" action="../controlador/subclase1.asp">
<table width="252" border="1">
<tr>
  <td width="89">Numero 1 </td>
  <td width="147"><label>
    <input type="text" name="num1" />
  </label></td>
</tr>
<tr>
  <td>Numero 2 </td>
  <td><label>
    <input type="text" name="num2" />
  </label></td>
</tr>
<tr>
  <td>&nbsp;</td>
  <td><label>
    <input type="submit" name="Submit" value="Enviar" />
  </label></td>
</tr>
</table>

</form>
</body>
</html>

the controller's: (name: subclass1.asp)

<!-- #include file="../modelo/recibirclase1.asp" -->
<%
num1=cINt(request.Form("num1"))
num2=cINt(request.Form("num2"))
set objeto = new ejemplo
objeto.suma num1, num2
response.Write(objeto.devolver)
%>

the model: (recibcse1.asp)

<%
class ejemplo

public resultado

public function suma(num1, num2)
resultado=num1+num2
end function

public function devolver()
devolver=resultado
end function

end class 
%>
    
asked by Joshua Mejía 23.04.2017 в 06:39
source

1 answer

0

I managed to solve it by placing it in the controller file:

<!--#include virtual="/ejemploclases/modelo/recibirclase1.asp" -->

where:

examplesclasses: is the root folder (containing the model, view and controller folders)

model: the folder that contains the class file

receiveclose1.asp: which is the file that contains the class

    
answered by 26.04.2017 / 00:45
source