简体   繁体   English

如何在asp.net C#中从一帧传递值并在另一帧接收?

[英]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.

相关问题 如何在asp.net c#中将GridView的值从一个页面传递到另一个页面? - How to pass value of GridView from one page to another in asp.net c#? 用JavaScript调用另一个框架ASP.NET C#函数 - calling another frame ASP.NET C# function with javascript 如何将SQL结果从一页传递到另一C#asp.net - How to pass SQL results from one page to another C# asp.net 如何在C#(ASP.NET 2.0)中将值从一个类返回到另一个 - How to return a value from one class to another in C# (ASP.NET 2.0) 将一行从网格视图传递到另一个网格视图asp.net C# - Pass one row from grid view to another grid view asp.net c# 如何在ASP.net C#中将诸如用户名和密码之类的文本框值安全地从一页传递到另一页 - How to pass text box values like username and password securely from one page to another in ASP.net C# 如何使用 C# 在 ASP.NET 核心 MVC 中将 model 从一个动作传递到另一个动作而不使用 TempData - How to pass model from one action to another without using TempData in ASP.NET Core MVC using C# 在C#ASP.NET中将值从视图传递到视图模型 - Pass Value from view to viewmodel in c# ASP.NET 将值从C#asp.net传递到JAVASCRIPT不起作用 - Pass value from C# asp.net to JAVASCRIPT not working 捕获帧而不是视频 AForge C# ASP.NET - Capture Frame Not Video AForge C# ASP.NET
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM