Archive for the ‘Classic ASP’ Category

How to post an html form to mvc

September 11, 2012

1)     The controller name isCompletionController. The URL of the form action is:

<form action=”http://localhost:36102/Completion/ReceiveCompletionForm” method=”post”>

Note that the url doesn’t contain “Controller”

2)     The controller looks like this:

[HttpPost]
public ActionResult ReceiveCompletionForm(FormCollection collection)
{

3)     I didn’t define a route – this was my default global.asax

routes.MapRoute(
"Default", // Route name
"{controller}/{action}/{id}", // URL with parameters
new { controller = "Home", action = "Index", id = UrlParameter.Optional } // Parameter defaults
);

Note that there is nothing in the route about the FormCollection input to the controller.

Advertisements

initialize soap from ASP

September 23, 2009

Soap doesn’t like relative paths, but I want to create a path string so that my code runs both locally and on the server.

' 1) web service setup
dim servername
servername = request("SERVER_NAME")

dim strSoapObjectLibrary

if ( lcase(servername) = "localhost" ) then
strSoapObjectLibrary = "MSSOAP.SoapClient" ' works on WinXP
else
strSoapObjectLibrary = "MSSOAP.SoapClient30" ' change this to match whatever library is installed
end if

SET svc = Server.CreateObject(strSoapObjectLibrary)
svc.ClientProperty("ServerHTTPRequest") = True

' make the path to the web service somewhat dynamically
dim sPath
if ( lcase(servername) = "localhost" ) then
sPath = "http://localhost"
else
sPath = "https://" + servername ' change this to match whatever library is installed
end if

sPath = sPath + "/WQQQ2/ws/wsQuotes.asmx"
sPath = sPath + "?WSDL"
'response.Write(sPath)

Call svc.mssoapinit(sPath,"wsQuotes")