一页中的aspControl的Acces/Set属性到另一页 [英] Acces/Set property of aspControl in one page to another page

查看:60
本文介绍了一页中的aspControl的Acces/Set属性到另一页的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在button1_Click上(在Default2.aspx中)我要隐藏一个TextBox1(在Default1.aspx中)


如何公开TextBox1(在Default1.aspx中)的可见属性.
以及如何在button1_Click(在Default2.aspx中)中使用它来隐藏文本框.在Web应用程序中,直到您不使用Default1.aspx为止.您无法从另一个页面(Default2.aspx)访问页面成员.,因为该页面(及其成员)尚未初始化.

但您可以通过跨页发布访问上一页.意味着当您登陆从Default2.aspx重定向的Default1.aspx时,则可以访问Default2.aspx的最后状态.

请点击链接以了解如何使用跨页发布.


http://msdn.microsoft.com/en-us/library/ms178139.aspx [ ^ ]

如果解决您的问题,则标记为答案


On button1_Click (in Default2.aspx) I want to hide a TextBox1(in Default1.aspx)

ie.
How to make the visible-Property of TextBox1(in Default1.aspx) public.
and how to use it in button1_Click (in Default2.aspx) to hide the textbox.

解决方案

in web applications, untill you are not on Default1.aspx. you can not access the page members.. from another page (Default2.aspx), because the page (and its members) are not yet initialised.

but you can access your previous page with cross page posting. means while you land on Default1.aspx redirected from Default2.aspx, then you can access Default2.aspx''s last state.

follow the link to know how to use cross page posting.


http://msdn.microsoft.com/en-us/library/ms178139.aspx[^]

mark as answer if solves your problem


这篇关于一页中的aspControl的Acces/Set属性到另一页的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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