[英]How to pass a value from one frame and receive in another frame in asp.net C#?
I have 2 content pages and I use these 2 pages in a third page as frames in 50% 50% ratio. 我有2个内容页面,并在第三页中以50%50%的比例将这两个页面用作框架。
I want a TextBox value from Left frame to be transferred to the right frame on a button click. 我希望单击按钮时将“左框架”中的TextBox值传输到右框架。
If I use session
and try to receive the session value in the 2nd web page(which is the right frame) it won't work because the right frame which is actually a content page will never be invoked. 如果我使用
session
并尝试在第二个网页(正确的框架)中接收会话值,则它将无法正常工作,因为实际上不会调用正确的内容页面。
Please, can someone give me the correct and best way to solve this problem. 请,有人可以给我正确和最佳的方法来解决此问题。
Create an event in frame one and make frame 2 have an event handler. 在第一帧中创建一个事件,并使第二帧具有一个事件处理程序。 On each action in frame 1 you can respond in frame 2.
您可以在第1帧中对第1帧中的每个动作进行响应。
You can transfer data using a custom class that inherits from EventArgs. 您可以使用从EventArgs继承的自定义类传输数据。
public class MyEventArgs : EventArgs
{
// add fields and constructor here
// initialize the fields in the constructor
}
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.