加入收藏 | 设为首页 | 会员中心 | 我要投稿 天瑞地安资讯网_保定站长网 (https://www.52baoding.com/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 站长学院 > Asp教程 > 正文

使用上一个ASP页面中的变量

发布时间:2022-10-05 16:05:53 所属栏目:Asp教程 来源:
导读:  本文介绍了使用上一个ASP页面中的变量的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

  问题描述

  在我的第一页上,我定义了一个数组:

  On my fir
  本文介绍了使用上一个ASP页面中的变量的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
 
  问题描述
 
  在我的第一页上,我定义了一个数组:
 
  On my first page I have an array defined as:
 
  dim selection
      selection = Array("name", "city")
  在下面的ASP页面上,我想调用相同的变量,但是我很难弄清楚该如何做.这是我尝试不同解决方案时的基本结构,但这是行不通的,我的结果总是空白,因为我认为我没有正确调用变量:
 
  On the following ASP page I'd like to call the same variables but I'm having a hard time figuring out how. This has been my basic structure as I attempt different solutions but this does not work, my results are always blank because I don't think I'm calling the variables correctly:
 
  dim userselect
      userselect = request.form("selection(0)")
  dim cityselect
      cityselect = request.form("selection(1)")
  如果我可以在VBS中很好地做到这一点,如果我可以在Javascript中做到这一点,那太好了,但是我不确定从哪里开始,希望能得到一些帮助.
 
  If I can do this in VBS great, if I can do this in Javascript, awesome, but I'm not sure where to start and would appreciate some help.
 
  推荐答案
 
  您有一些选择,
 
  或者,您将这些值放在第一页的html表单中,然后将其发布到第二页,然后是 request.form 值;
 
  或者您调用第二页并通过调用者名称(例如 page2.asp?varname = varvalue )传递值,然后您 request.querystring >这些值在第二页上;
 
  或者您使用会话变量.例如: session("varname")= varvalue ,然后通过 session("varname")方式将其显示在第二页上.例如:response.write(session("varname")).
 
  You have some options,
 
  Or you put the values inside an html form on the first page and post it to the second page and then request.form values;
 
  Or you call the second page and pass the values by the caller name (ex. page2.asp?varname=varvalue), then you request.querystring these values on your second page;
 
  Or you use session variables. Ex.: session("varname")=varvalue then you get it on second page by this way session("varname"). For example: response.write(session("varname")).
 
  在使用数组时,事情变得很复杂,但只有一点点.您已经知道如何处理它们.
 
  As you're using arrays, things gets complicated, but just a bit. You've already know how to deal with'em.
 
  这篇关于使用上一个ASP页面中的变量的文章就介绍到这了ASP 变量,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
 

(编辑:天瑞地安资讯网_保定站长网)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!