类型错误:“NamedScriptAttribute”使用 ActivePython3 在 ASP 中调用 Request 时

发布于 2025-01-02 22:51:26 字数 1099 浏览 1 评论 0原文

这是我的 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

许你一世情深 2025-01-09 22:51:26

我认为这是我应该做的:

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

我不确定 Request("btnSubmit") 实际上在做什么,因为这里没有记录它:

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

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

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文