Python 2.1.1 ASP/Response object does not HONOR Response.End() 
Author Message
 Python 2.1.1 ASP/Response object does not HONOR Response.End()

When using Python/ASP if you call the Response.End() method the rest of the
script is still processed

For Example:

** Script **


<%
Response.Write("This is line 1")
Response.Write("This is line 2")
Response.End()
Response.Write("This is line 3")
%>
This should NOT appear.

** End Script **

"This is line 3" and "this should NOT appear." both appear in the page
results.

Testing the same script with VBScript produces the correct results.

Is this a known bug?



Sun, 11 Jan 2004 06:40:55 GMT  
 Python 2.1.1 ASP/Response object does not HONOR Response.End()

Response.end()

(note lower-case 'e')



Quote:
> When using Python/ASP if you call the Response.End() method the rest of
> the script is still processed

> For Example:

> ** Script **


> <%
> Response.Write("This is line 1")
> Response.Write("This is line 2")
> Response.End()
> Response.Write("This is line 3")
> %>
> This should NOT appear.

> ** End Script **

> "This is line 3" and "this should NOT appear." both appear in the page
> results.

> Testing the same script with VBScript produces the correct results.

> Is this a known bug?



Sun, 11 Jan 2004 22:40:59 GMT  
 Python 2.1.1 ASP/Response object does not HONOR Response.End()
Thanks Jim.

Are all the methods supposed to be lower case.

I'm using the ASP documentation at
http://www.w3schools.com/asp/asp_ref_response.asp whichs shows the method
names with an upper case first letter.  I just did a test and Response.Write
and Response.write BOTH work.  I wonder why Response.End() doesn't raise an
AttributeError?

Do you have any good sources for documentation using python and ASP?  There
do not seem to be many and those that I have found are minimal at best.


Quote:
> When using Python/ASP if you call the Response.End() method the rest of
the
> script is still processed

> For Example:

> ** Script **


> <%
> Response.Write("This is line 1")
> Response.Write("This is line 2")
> Response.End()
> Response.Write("This is line 3")
> %>
> This should NOT appear.

> ** End Script **

> "This is line 3" and "this should NOT appear." both appear in the page
> results.

> Testing the same script with VBScript produces the correct results.

> Is this a known bug?



Mon, 12 Jan 2004 02:16:32 GMT  
 Python 2.1.1 ASP/Response object does not HONOR Response.End()


Quote:
>Thanks Jim.

>Are all the methods supposed to be lower case.

>I'm using the ASP documentation at
>http://www.w3schools.com/asp/asp_ref_response.asp whichs shows the
>method names with an upper case first letter.  I just did a test and
>Response.Write and Response.write BOTH work.  I wonder why
>Response.End() doesn't raise an AttributeError?

>Do you have any good sources for documentation using Python and ASP?
>There do not seem to be many and those that I have found are minimal at
>best.

Unfortunately I don't have any good documentation sources, and most of what
I know was learned the hard way.

If you know ASP and have a good 'feel' for Python you have a good start.
Just think how Python works and try applying it to ASP and things usually
fell into place for me.

Here are a bunch of other things to look out for. I wonder... is there a
Python in ASP faq? Maybe it's time to start one.

Session.SetValue(key, val)
Application.SetValue(key, val)
Is how you set Session and Application vars from Python.

Modules are cached and need to be explicitly reloaded. i.e. reload(module)

global.asa: You need some VBscript first, then the Python one will work.
<SCRIPT LANGUAGE=VBScript RUNAT=Server>
function noOp()
end function
</SCRIPT>

<script language=Python runat=server>
def Application_OnStart():
        pass #stuff
</SCRIPT>

You can't mix HTML in code blocks.
<%if 1:%>
  <tags>
<%else:%>
  <tags>

This doesn't work for obvious reasons. Check out HTMLgen for some easy
alternatives.

And there's a bunch more I can't think of right now, but go check through
the c.l.py archives for ASP and lots of good info will emerge.



Mon, 12 Jan 2004 04:24:14 GMT  
 
 [ 4 post ] 

 Relevant Pages 

1. Python + Win32ALL + ASP = Problems accessing Request/Response/Session/Application objects

2. Win32 ASP Problems (Response.End)

3. Function return values revisted (response to response)

4. httplib: response.read() vs response.read(size)

5. Slightly Off Topic : restrictions on the response part in a SOAP-response

6. Win32 ASP Problems (Response.Redirect)

7. newbie question: program ends before the snmp responses came back

8. Impulse Response Function PtByPt (Not in Base Package)

9. Response to C++/F90 Object-Oriented Issues...

10. how to make SEND not expect a response

11. automating email responses with python

12. Global object in ASP (calling other scripting languages in ASP pages)

 

 
Powered by phpBB® Forum Software