【问题标题】:call a c# .net aspx script from regular html从常规 html 调用 c# .net aspx 脚本
【发布时间】:2009-05-06 14:59:12
【问题描述】:

如何从常规 html 文件执行表单 POST。并调用以 .aspx 结尾的 .net 文件 我的 html 文件需要什么?

【问题讨论】:

    标签: .net asp.net html


    【解决方案1】:
    <form method="Post" action="YourNETFile.aspx">
       ... other form elements
    </form>
    

    然后在您的 aspx 代码后面,您可以通过以下方式访问表单元素: Request.Params["FormElementName"]

    【讨论】:

    • 我唯一要补充的是,您的 aspx 文件可能需要关闭视图状态验证。
    【解决方案2】:

    某种形式

    <form action="location of aspx" method="Get|post">
       <input name="variable name" value="variable value" type="text|hidden|etc" />
    </form>
    

    例如: http://www.w3.org/TR/html401/interact/forms.html

    【讨论】:

      【解决方案3】:

      只需将其作为表单的action 即可。您需要记住的只是确保您的字段按照 CodeBehind 的要求命名。

      干杯!

      附言似乎发布答案现在是“节拍”的游戏

      【讨论】:

      • 嘿,一段时间以来,发布答案一直是一场“争分夺秒”的游戏;)
      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2015-01-16
      • 1970-01-01
      • 1970-01-01
      • 2019-06-17
      • 2014-09-04
      • 2017-11-02
      相关资源
      最近更新 更多