page.ispostback问题 [英] page.ispostback question
问题描述
我有一个例程,我只想在变量设置为Y时执行。
例程在屏幕上获取一些信息然后重定向到新的
页。
如何将变量传递给page_load
事件的Page.IsPostBack例程?
这是我正在尝试做什么/
sub page_load
if page.ispostback then
dim value as string = CType(Session(") ; quesiton),string)
if value =" Y"然后
''执行我的例程
else
''做我的数据网格数据绑定等等
结束如果
结束如果
感谢
>如何将变量传递给
page_load事件中的Page.IsPostBack例程?
QueryString ?曲奇饼?会话变量?
-Darrel
创建标签并将其visibility属性设置为false。在
非回发代码中,将该标签的text属性设置为Y。如果你的
条件得到满足。在回发代码中,只需检查
的文本属性为Y的标签。
" Mike" <弥** @ discussions.microsoft.com>在留言中写道
news:84 ********************************** @ microsof t.com ...我有一个例程,我只想在变量设置为Y时执行。
例程在屏幕上获取一些信息然后重定向到<新的
页面。
如何将变量传递给
page_load
事件中的Page.IsPostBack例程?
这是什么我正在尝试/
sub page_load
如果page.ispostback然后
dim值为string = CType(Session(" quesiton"),string)
if value =Y然后执行我的例程
然后
''做我的数据网格数据绑定等。
结束如果
结束如果
谢谢
我尝试了所有3并且它没有获得传递的变量的值,
那是我发布的问题,看看是否在我的代码中有另一种方式或编码错误
。
i需要在点击页面上的按钮时传递变量并且只需要
那个时间
darrel写道:
如何将变量传递给上的Page.IsPostBack例程页面
事件?
QueryString?曲奇饼?会话变量?
-Darrel
I have a routine that i only want to execute if a variable is set to Y. The
routine is getting some information on the screen then redirecting to a new
page.
How can i passed a variable to the Page.IsPostBack routine on the page_load
event?
this is what I''m trying to do/
sub page_load
if page.ispostback then
dim value as string = CType(Session("quesiton"), string)
if value = "Y" then
''execute my routine
else
''do my datagrid databinding, etc.
end if
end if
thanks
> How can i passed a variable to the Page.IsPostBack routine on the
page_loadevent?
QueryString? Cookie? Session Variable?
-Darrel
Create a label and set its visibility property to false. In the
non-postback code, set the text property of that label to "Y" if your
condition is met. In the postback code, simply check the text property of
the label for "Y".
"Mike" <Mi**@discussions.microsoft.com> wrote in message
news:84**********************************@microsof t.com...I have a routine that i only want to execute if a variable is set to Y. The
routine is getting some information on the screen then redirecting to a
new
page.
How can i passed a variable to the Page.IsPostBack routine on the
page_load
event?
this is what I''m trying to do/
sub page_load
if page.ispostback then
dim value as string = CType(Session("quesiton"), string)
if value = "Y" then
''execute my routine
else
''do my datagrid databinding, etc.
end if
end if
thanks
i tried all 3 and its not getting the value of the variable being passed,
thats i posted the question to see if there was another way or a coding error
in my code below.
i need to pass the variable when a button on the page is clicked and only
that time
"darrel" wrote:
How can i passed a variable to the Page.IsPostBack routine on the
page_loadevent?
QueryString? Cookie? Session Variable?
-Darrel
这篇关于page.ispostback问题的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!