类型错误:“NamedScriptAttribute”使用 ActivePython3 在 ASP 中调用 Request 时
这是我的 asp 代码:
<%@ Language = Python%>
<%
def main():
a = Request("btnSubmit")
main()
%>
这给了我错误:
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
有什么想法为什么我会收到此错误吗?
我已经设法让这个脚本正常工作:
<%@ Language = Python%>
<%
def main():
Response.Write("My first ASP script!")
main()
%>
以及这个使用 VBScript 的脚本:
<%
a = Request("btnSubmit")
%>
问题是我正在从事的项目计划在不久的将来移植到 ASP .NET,对此我更加期待熟悉。然而现在我需要掌握 ASP Classic。然而,当我看到如何使用 VBScript 实现这些功能时,我感到很想哭,并且认为一定有更好的方法来做到这一点。这就是为什么我想尽可能使用Python。但稳定吗?值得付出努力吗?请指教。
谢谢,
巴里
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
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我认为这是我应该做的:
我不确定 Request("btnSubmit") 实际上在做什么,因为这里没有记录它:
http://www.w3schools.com/asp/asp_ref_request.asp
I think this is what I should be doing:
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