TypeError: 'NamedScriptAttribute' when calling Request in ASP with ActivePython3

0

Here's my asp code:

<%@ Language = Python%>
<%
def main():
    a = Request("btnSubmit")
main()
%>

This is giving me the error:

Error Type:
    Python ActiveX Scripting Engine (0x80020009)
    Traceback (most recent call last): File "<Script Block >", line 3, in <module> main() File "<Script Block >", line 2, in main a = Request("btnSubmit") TypeError: 'NamedScriptAttribute' object is not callable
    /website/test.asp, line 4
    a = Request("btnSubmit")

Browser Type:
Mozilla/5.0 (Windows NT 5.1; rv:9.0.1) Gecko/20100101 Firefox/9.0.1

Page:
GET /website/test.asp

Any ideas why I get this error?

I have managed to get this script to work correctly:

<%@ Language = Python%>
<%
def main():
    Response.Write("My first ASP script!")
main()
%>

As well as this one with VBScript:

<%
a = Request("btnSubmit")
%>

The thing is that the project I'm working in is planning on porting to ASP .NET in the near future, which I'm a lot more familiar with. However just now I need to get to grips with ASP Classic. However when I look at how things are implemented using VBScript I feel like crying and think there must be a better way of doing this. Thats why I want to used Python if possible. But is it stable? Is it worth the effort? Please advise.

Thanks,

Barry

python
asp-classic
vbscript
python-3.x
pywin32
asked on Stack Overflow Feb 6, 2012 by Baz • edited Feb 8, 2012 by Baz

1 Answer

0

I think this is what I should be doing:

<%@ Language = Python%>
<%
def main():
    a = Request.QueryString["btnSubmit"]
main()
%>

I'm not sure what Request("btnSubmit") is doing actually as it is not documented here:

http://www.w3schools.com/asp/asp_ref_request.asp

answered on Stack Overflow Feb 8, 2012 by Baz

User contributions licensed under CC BY-SA 3.0