Login  
Search All Forums
Dart Home | PowerTCP WebServer for ActiveX | Custom Development Reply | Return to search results | Forums   
AuthorForum: PowerTCP WebServer for ActiveX
Topic: .asp problem, can't resolve and response form data correctly
timothy

From: Hong Kong, AL USA
Posts: 12
Member Since: 01/02/03
posted January 2, 2003 4:07 AM

How can I use .asp file in WebServer Tool?
I found that it can't resolve .asp scripts..
just show the whole .asp file content <%xxxxx %> in IE. The whole script can't run exactly.
However, I just want to receive a form post from HTML, and generate a dynamic content by asp. I think it's simple. But, I really don't know how to do it with WebServer Tools. Can you help me? Thanks.


Tony Priest



From: Utica, NY USA
Posts: 8466
Member Since: 04/11/00
posted January 2, 2003 9:02 AM

You'd have to find some way of producing the result of the page and then sending that result as the response. The Webserver tool does not contain a code interpreter. That's something you would have to add yourself.

timothy

From: Hong Kong, AL USA
Posts: 12
Member Since: 01/02/03
posted January 2, 2003 8:55 PM

Is that means WebServer Tools will not support any ASP code interpreter?
http://202.60.242.135/testpost.asp
It is made by WebServer Tools. But, I found that it can't interpreter any code. If WebServer Tools doesn't support it, I have 2 questions.
1) how can I made it support ASP?
2) How can it receive the request.form post data and generate dynamic html?
Thanks.
Jeff Cranford



From: Rome, NY USA
Posts: 586
Member Since: 05/30/01
posted January 3, 2003 9:07 AM

As Tony stated, our WebServer Tool is completely independent of IIS. For that reason, it is unable to "interpret" ASP code. The WebServer Tool was designed to be an alternative to IIS, you write the server-side code in your development environment (such as Visual Basic).

So, to answer your questions:

1) It does not support ASP. If you find it necessary it is possible that you could add an ASP interpreter to your WebServer application (by using something like Microsoft Script Engine) but this would be (a) outside of the scope of this forum and (b) contrary to the purpose and design of the WebServer Tool.

2) This is quite easy using the WebServer Tool. To get you started, I would check out our online WebServer Tool tutorial ( http://www.dart.com/tutorials/webserver1_1.asp ).After this, you may want to move on to our Samples that were installed with the WebServer Tool and see how they work. Read about the Request object in the documentation. You will find it works very similarly to ASP's Request object.
Biggy

From: NA
Posts: 8
Member Since: 01/22/03
posted January 22, 2003 7:38 AM

This ASP thing is an issue and people seem confused (that includes me).
Can someone just post a sample of an application that simulates ASP. Or beterstill can we have the source code for this forum? Afterall it will only aid in selling the product.
Jeff Cranford



From: Rome, NY USA
Posts: 586
Member Since: 05/30/01
posted January 27, 2003 9:38 AM

The code for the old support forum is available with the installation. Check the WebForum sample in your install directory.

Here is a quick example/comparison. I'm sure you are familiar with the basic ASP functionality of retrieving posted form variables. This demonstration shows the equivalent of this functionality using the WebServer Tool (remember, this is completely IIS and ASP independent).

Create a simple HTML form like so:

<html>
<body>
<form method="post" action="myformhandler.htm">
Enter username: <input type="text" name="username"><br>
Enter password: <input type="text" name="password"><br>
<input type ="submit">
</form>
</body>
</html>

Save it as form.htm in C:\Root (this will be the WebServer Root Directory).

Start a new VB project and add a button to the form. In the onClick event of the button, set the root directory and start the server like so:

Private Sub Command1_Click()
  WebServer1.RootDirectory = "C:\Root"
  WebServer1.Start 80, -1
End Sub

Now you have a WebServer application which, once started, will serve up any pages contained in C:\Root. Recall the data in the file form.htm is being posted to myformhandler.htm. This page does not exist so we have to check for the request in the POST event and create the response dynamically. This should look something like this:

Private Sub WebServer1_Post(ByVal Session As DartWebServerCtl.ISession, ByVal Request As DartWebServerCtl.IRequest, ByVal Response As DartWebServerCtl.IResponse)
  ' Check for a request to the form handler
  If Request.FileName = "/myformhandler.htm" Then
    Response.Body.Clear
    Response.Body.Write ("<html>")
    Response.Body.Write ("<body>")
    Response.Body.Write ("Value of username = " & Request.Variables("username") & "<br>")
    Response.Body.Write ("Value of password = " & Request.Variables("password"))
    Response.Body.Write ("</body>")
    Response.Body.Write ("</html>")
    Response.Status = httpOK
  End If
End Sub

Now open your browser and load http://localhost/form.htm. Fill out the fields and POST the data.

Hope this helps!
Biggy

From: NA
Posts: 8
Member Since: 01/22/03
posted February 3, 2003 7:15 AM

ThanX Jeff. Now I understand the concept - your application takes control of the codes! It is wonderful. I was able to do database authentication and retrieval in minutes.

Cheers.
Reply | Return to search results | Forums   
This site is powered by PowerTCP WebServer Tool PowerTCP WebServer for ActiveX