dongyi0210 2015-07-30 19:49
浏览 23
已采纳

将表单数据有效地发布到两页

I am working in a classic ASP project where the flow was like this:

a ----> b ------> c

and another flow was like this:

a ------> d -------> c

but now, due to a change in requirements, the flow needs to be like this:

a -----> b -----> d ------> c

The form data which was previously posted to page d now needs to be posted to page b. Is there any way to post this data again from b to d?

I have kept those values in a session in b.asp but, in that case, I have to change the existing design in page d since request.form() is used to read those.

Is there any better way to do this without changing the design in page d? Can the form variables posted in b be again posted in d?

  • 写回答

1条回答 默认 最新

  • doumiang0597 2015-07-30 22:46
    关注

    In page B, create a <form> and write the session values to <hidden> form elements. I'm not sure how your b.asp page functions, but you can write the form on the initial page load or a post-back and have it submit automatically or you could have a client action submit the form.

    For example, to create a page that just forwards the POST to d.asp:

    Response.Clear
    Response.Write "<html>"
    Response.Write "<body onload='document.forms[""form""].submit()'>"
    Response.Write "<form name='form' action='d.asp' method='post'>"
    
    ' For each Session variable...
    Response.Write "<input type='hidden' name='SomeVar' value='" & Session("SomeVar") & "'>"
    
    ' Or, for each Form variable...
    Response.Write "<input type='hidden' name='SomeVar' value='" & Request.Form("SomeVar") & "'>"
    
    Response.Write "</form></body></html>"
    Response.End
    
    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥20 BAPI_PR_CHANGE how to add account assignment information for service line
  • ¥500 火焰左右视图、视差(基于双目相机)
  • ¥100 set_link_state
  • ¥15 虚幻5 UE美术毛发渲染
  • ¥15 CVRP 图论 物流运输优化
  • ¥15 Tableau online 嵌入ppt失败
  • ¥100 支付宝网页转账系统不识别账号
  • ¥15 基于单片机的靶位控制系统
  • ¥15 真我手机蓝牙传输进度消息被关闭了,怎么打开?(关键词-消息通知)
  • ¥15 装 pytorch 的时候出了好多问题,遇到这种情况怎么处理?