嘿 大家瞧瞧这老外在页面之间传递元素的办法

2016-01-29 19:39 0 1 收藏

嘿 大家瞧瞧这老外在页面之间传递元素的办法,嘿,大家瞧瞧这老外在页面之间传递元素的办法

【 tulaoshi.com - ASP 】

       在第三方页面传递参数这个思路倒是的确可以省下一些代码,至少我以前是从没这样子传过。
  <%
   ''Pass form objects submitted by a form G
   '' ET
   If Request.QueryString.Count>0 Then
   QStr="?"
   For Each x In Request.QueryString
   QStr = QStr & x & "=" ''Write Name of Parameter
   QStr = QStr & Server.URLEncode(request.QueryString(x)) & "&" ''Write value of parameter
   Next
   QStrSz = len(QStr)-1
   QStr = LEFT(QStr,QStrSz)
   else
   QStr=""
   End If
   Response.Redirect("YourURL.asp" & QStr)
   %>
   The Next example shows how To build the submitted parameters from a form POST. The procedure reads all posted objects and builds a querystring parameter.
   <%
   ''Pass form objects submitted by a form G
   '' ET
   If Request.form.Count>0 Then
   QStr="?"
   For Each x In Request.form
   QStr = QStr & x & "=" ''Write Name of Parameter
   QStr = QStr & Server.URLEncode(request.form(x)) & "&" ''Write value of parameter
   Next
   QStrSz = len(QStr)-1
   QStr = LEFT(QStr,QStrSz)
   else
   QStr=""
   End If
   Response.Redirect("YourURL.asp" & QStr)
   %>
   The Next code example may be used as a test ASP page To redirect to. It reads the querystring and builds a table to display the parameter name and value passed.
   <%@ Language=VBScript %>
   <HTML>
   <BODY>
   <%
   Response.Write "<TABLE BORDER=1><TR><TH>Parameter</TH><TH>Value</TH></TR>"
   For Each x In Request.QueryString
   Response.write "<TR><TD>" & x & "</TD><TD>" ''Write Name of Parameter
   Response.write Request.QueryString(x) & "</TD></TR>" ''Write value of parameter
   Next
   Response.Write "</TABLE>"
   %>
   </BODY>
   </HTML>
  当然,上面这个东西的改进版本就简洁多了,再看这个
  <%
  If
  Request.QueryString.Count > 0 Then
  
  Response.Redirect("YourURL.asp?" &
  Request.QueryString
  Else
   If
  Request.Form.Count > 0 Then
  
  Response.Redirect("YourURL.asp?" &
  Request.Form)
   Else
  
  Response.Write("No Data Sent")
   End
  If
  End If
  %>
  原来可以整个抓取的,我也是刚刚知道,不敢独吞,拿出来共享
  
  
  

 

来源:https://www.tulaoshi.com/n/20160129/1509868.html

延伸阅读
      今天有朋友问我关于用JAVASCRIPT来进行页面各表单之间的数据传递的问题,我以前也写过,不过从来没有注意,今天总结了一下,希望能够给大家一些帮助,也帮助我总结以前学过,用过的知识。     一,最简单的就是同一个网页里的表单的数据传递。      举个实例,一个网页上有两...
标签: Web开发
利用Cookie:Cookie是浏览器存储少量命名数据.它与某个特定的网页或网站关联在一起。 Cookie用来给浏览器提供内存,以便脚本和服务器程序可以在一个页面中使用另一个页面的输入数据。 Post.htm 以下是引用片段: input type="text" name="txt1" input type="button" value="Post" script language="javascript" function set...
标签: Web开发
第一个:  Untitled Document [Ctrl+A 全选 注:如需引入外部Js需刷新才能执行]   第二个: [Ctrl+A 全选 注:如需引入外部Js需刷新才能执行]
从语法上看,在函数里声明参数与在catch子句中声明参数几乎没有什么差别: class Widget { ... }; //一个类,具体是什么类 // 在这里并不重要 void f1(Widget w); // 一些函数,其参数分别为 void f2(Widget& w); // Widget, Widget&,或 void f3(const Widget& w); // Widget* 类型 void f4(Widge...
标签: ASP
  往往使用动态网页技术制作ASP应用程序时一般至少拥有二个或二个以上的Web页面,这时就得考虑在多个Web页面间传递数据的处理工作。而ASP应用程序的各个页面类似于Windows应用程序的form窗体,Windows应用程序各form间数据传递可以通过定义全局变量等方法来实现。网页间的数据传递有多种不同的可使用方式,而Web页面间的数据传递方式...

经验教程

154

收藏

39
微博分享 QQ分享 QQ空间 手机页面 收藏网站 回到头部