访问另一个webform中的控件 [英] access a control in a another webform

查看:72
本文介绍了访问另一个webform中的控件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

请我在另一个webform中访问webform中的radiobutton的值,例如,如果检查webform1中的radiobutton2,那么当webform2中的button2被点击时,webform2中的texbox3应显示已检查(asp.net with vb。 net)

please I want to access the value of a radiobutton in a webform in another webform, e.g if radiobutton2 in webform1 is checked then texbox3 in webform2 should display "checked" when when button2 in webform2 is clicked (asp.net with vb.net)

推荐答案

也许您使用这样的查询字符串:



maybe you use querystring like this:

string url = "directTo.aspx";
if(chk.IsChecked)
{
   url += "?checked=1";  // or 2, 3, each represent a selection
}





Response.Redirect(url);



在directTo页面:



您可以从查询字符串中获取选中的号码,并确定选择了哪个按钮。



Response.Redirect(url);

In directTo page:

You can get the checked number form the querystring, and decide what button selected.


一种方法是使用JohnsonYuan建议的查询字符串。同样,可以使用任何一个

-Session,

-Page.PreviousPage.FindControl如果它被重定向到当前页面,

-Declare公开财产,公开您选中的复选框值。
One way is to use Query String as suggested by JohnsonYuan. Similarly , can use any one of
-Session,
-Page.PreviousPage.FindControl if its redirected to the current page ,
-Declare a public property which exposes your checkbox selected value.


这篇关于访问另一个webform中的控件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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