有关会话变量和重定向的问题 [英] Question about Session variables and Redirects

查看:64
本文介绍了有关会话变量和重定向的问题的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大家好:-)


我们有一个使用VB.net作为背后代码的APSX应用程序,它使用一个

或两个会话变量页。这些Session变量传递给

最后一页,并在那里完成计算和摘要。为了使所有值显示在最后一页上,用户必须查看每个页面

,其中有一个会话变量要传递到最后一页。我认为绕过用户查看每个页面的必要性的唯一方法是,如果应该传递的值为零,则重定向是
。这可能会在需要再次查看的每个页面中结束
。有没有人知道一种方式

来获取会话值而无需将用户重定向到每个页面?或者,

有一种方法可以设置最后一页为每个页面运行重定向

而不会让它们可见,并发布一条JavaScript消息说

应用程序正在运行计算,这个过程可能需要一些时间吗?任何建议都将不胜感激。


TIA


Coleen

Hi All :-)

We have an APSX application using VB.net as the code behind, which uses one
or two session variables per page. These Session variables are passed to
the final page and calculations and summaries are done there. In order for
all of the values to appear on the last page, the user has to view each page
that has a session variable to be passed to the last page. The only way I
can think of to bypass the necessity of the user viewing each page is to do
a redirect if the value that is supposed to be passed is zero. This could
end up in every page needing to be viewed again. Does any one know of a way
to get the session values without redirecting the user to every page? Or,
is there a way to set the last page to run through a redirect for each page
without making them visible, and posting a JavaScript message saying that
the application is running the calculations and the process may take a few
moments? Any suggestions would be greatly appreciated.

TIA

Coleen

推荐答案

我必须说我不太确定你的意思,但你似乎把变量

传递给页面而且那不是会话变量。


您不需要通过页面传递的会话变量,您只需设置

然后阅读它们。


Session( " Page1_Variable1")=" Value"

Session(" Page1_Variable2")=" Value"

等......


或者...


您可以在Global.aspx页面中设置变量,而不是一直可以访问




或者我是否误解了你?


/ Lars Netzel

" Coleen" <共********** @ yaho.com> skrev i meddelandet

新闻:eq ************* @ TK2MSFTNGP09.phx.gbl ...
I must say I''m not really sure what you mean but you seem to pass variables
to pages and that''s not session variable.

Session variables you don''t need to pass along thru the pages, you just set
them and then read them.

Session("Page1_Variable1") = "Value"
Session("Page1_Variable2") = "Value"
etc...

Or...

You can set Variables in the Global.aspx page instead that you can access
all the time

Or did I misunderstand you?

/Lars Netzel
"Coleen" <co**********@yaho.com> skrev i meddelandet
news:eq*************@TK2MSFTNGP09.phx.gbl...
大家好: - )

我们有一个使用VB.net作为代码的APSX应用程序,每页使用
一个或两个会话变量。这些Session变量传递给最终页面,并在那里完成计算和摘要。对于要在最后一页上显示的所有值的
,用户必须查看每个
页面,该页面具有要传递到最后一页的会话变量。我想要绕过用户查看每个页面的必要性的唯一方法是
如果应该传递的值为零则进行重定向。这可能会在每个需要再次查看的页面中结束。有没有人知道
方式来获取会话值而无需将用户重定向到每个页面?或者,有没有办法设置最后一页运行每个
页面的重定向,而不会让它们可见,并发布一条JavaScript消息,说明应用程序正在运行计算和这个过程可能需要一些时间吗?任何建议都将不胜感激。

TIA

Coleen
Hi All :-)

We have an APSX application using VB.net as the code behind, which uses one or two session variables per page. These Session variables are passed to
the final page and calculations and summaries are done there. In order for all of the values to appear on the last page, the user has to view each page that has a session variable to be passed to the last page. The only way I
can think of to bypass the necessity of the user viewing each page is to do a redirect if the value that is supposed to be passed is zero. This could
end up in every page needing to be viewed again. Does any one know of a way to get the session values without redirecting the user to every page? Or,
is there a way to set the last page to run through a redirect for each page without making them visible, and posting a JavaScript message saying that
the application is running the calculations and the process may take a few
moments? Any suggestions would be greatly appreciated.

TIA

Coleen



Hi Coleen ,


除了Lars,


会话变量保持与用户的连接(通常使用cookie)
$ b只要会话处于活动状态,$ b就可以了。


只要设置了这个,或者只要没有会话就可以。

abort


您在任何页面上制作的所有会话变量在此期间为

客户保留一次性。


我希望这有帮助吗?


Cor
Hi Coleen,

In addition to Lars,

The session variables stays connected to the user (normaly using the cookie)
as long as the session is active.

That can be as long as that is set or as long as that there is no session
abort

All session variables you make on whatever page stay disposable for the
client during that time.

I hope this helps?

Cor


我想在没有展示应用程序如何工作的情况下很难解释。

好​​的,我们从登录页面开始,这为

报告期间设置了一个会话变量,该变量传递给每个查看的页面。从那里,用户

选择工作表。其中查看两个摘要页面的值。那些

值是从数据库中检索的,但是来自工作表

的值需要传递到最后一页 - 退税。 (这不是收入

纳税申报表)我们使用

会话变量将值传递给工作表的纳税申报表。问题是,如果用户没有首先查看所有

工作表,则这些值不会传递到纳税申报表。是否有一种

的方式让我将它们从纳税申报表重定向到特定的工作表,如果

该工作表缺少值?我知道我可以做一个

Response.Redirect(),但我可能需要进行多次重定向,如果他们有错误查看多个工作表,那我就错了...我只是想知道是否有办法

重定向他们而不实际加载页面。可能会重定向,但不会使页面可见,并发布弹出消息让

他们知道纳税申报表正在收集信息(你知道输入

说获取信息,这可能需要几分钟......


我希望这能澄清我的问题。有什么建议吗?TIA


Coleen

" Lars Netzel" [stop_spam] @ host.topdomain>写在留言中

news:% 2 **************** @ TK2MSFTNGP10.phx.gbl ...
I guess it''s difficult to explain without showing how the application works.
Okay, we start with a logon page, this sets a session variable for the
report period that is passed to every page viewed. From there, the user
selects "worksheets" where values from two summary pages are viewed. Those
values are retrieved from the database, but the values from the "worksheets"
need to be passed to the last page - the "Tax Return" (this is not an income
tax return) We pass the values to the tax return from the worksheets using
session variables. The problem is that if the user does not view all of the
worksheets first, the values do not get passed to the tax return. Is there a
way for me to redirect them from the tax return to a specific worksheet, if
the value is missing for that worksheet? I know I can do a
Response.Redirect(), but I may need to do multiple redirects, if they have
missed viewing multiple worksheets...I was just wondering if there is a way
to redirect them with out actually loading the page. Something that would
redirect, but not make the page visible, and post a pop-up message to let
them know the tax return is gathering the information (you know the type
that say "Getting information, this may take a few minutes..."

I hope this clarifies my problem. Any suggestions? TIA

Coleen
"Lars Netzel" <[stop_spam]@host.topdomain> wrote in message
news:%2****************@TK2MSFTNGP10.phx.gbl...
我必须说我不太确定你的意思,但你似乎将
变量传递给页面并且这不是会话变量。

您不需要通过页面传递的会话变量,只需
设置它们和然后阅读它们。

会话(Page1_Variable1)=价值
会话(Page1_Variable2)=价值
等...
你可以设置Varia在Global.aspx页面中你可以随时访问

或者我误解了你吗?

/ Lars Netzel

" Coleen" <共********** @ yaho.com> skrev i meddelandet
新闻:eq ************* @ TK2MSFTNGP09.phx.gbl ...
I must say I''m not really sure what you mean but you seem to pass variables to pages and that''s not session variable.

Session variables you don''t need to pass along thru the pages, you just set them and then read them.

Session("Page1_Variable1") = "Value"
Session("Page1_Variable2") = "Value"
etc...

Or...

You can set Variables in the Global.aspx page instead that you can access
all the time

Or did I misunderstand you?

/Lars Netzel
"Coleen" <co**********@yaho.com> skrev i meddelandet
news:eq*************@TK2MSFTNGP09.phx.gbl...
大家好:-)
<我们有一个使用VB.net作为代码的APSX应用程序,它使用
Hi All :-)

We have an APSX application using VB.net as the code behind, which uses


一个

或每页两个会话变量。这些Session变量将
传递给最终页面,并在那里完成计算和摘要。按顺序
or two session variables per page. These Session variables are passed to the final page and calculations and summaries are done there. In order


对于

最后一页上显示的所有值,用户必须查看每个
all of the values to appear on the last page, the user has to view each


页面

具有要传递到最后一页的会话变量。
我能想到的唯一方法是绕过用户查看每个页面的必要性
that has a session variable to be passed to the last page. The only way I can think of to bypass the necessity of the user viewing each page is to


如果值应该是


do

重定向传递为零。这个
可能会在每个需要再次查看的页面中结束。有没有人知道
a redirect if the value that is supposed to be passed is zero. This could end up in every page needing to be viewed again. Does any one know of a

方式
来获取会话值而不将用户重定向到每个页面?
或者,有没有办法设置最后一页为每个
to get the session values without redirecting the user to every page? Or, is there a way to set the last page to run through a redirect for each


页面

重定向,而不会让它们可见,并发布一条JavaScript消息说
应用程序正在运行计算,这个过程可能需要花费
几分钟?任何建议都将不胜感激。

TIA

Coleen
without making them visible, and posting a JavaScript message saying that the application is running the calculations and the process may take a few moments? Any suggestions would be greatly appreciated.

TIA

Coleen




这篇关于有关会话变量和重定向的问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆