简体   繁体   English

是否可以从同一解决方案中将项目A中的一个页面重定向到项目B中的页面

[英]Is it possible to redirect from one page in Project A to a page in Project B from within the same solution

I have two projects, Project A and Project B. Both are under same Solution. 我有两个项目,项目A和项目B.两个项目都在同一个解决方案下。 I want use a page of Project A in Project B. How to call that page from Project B. Thanks in advance. 我想在项目B中使用项目A的页面。如何从项目B调用该页面。提前感谢。

Its possible to acceess another solution forms you have 2 projects in the same solution. 它可以加入另一种解决方案,在同一解决方案中有2个项目。

To open a form from another project, you have to add a reference to that project. 要从另一个项目打开表单,您必须添加对该项目的引用。

In the first project, right-click on the References item in the Solution Explorer window. 在第一个项目中,右键单击“解决方案资源管理器”窗口中的“引用”项。

Select the Add Reference option. 选择“添加引用”选项。 Select the Projects tab and select the second project. 选择Projects选项卡,然后选择第二个项目。

Click OK. 单击确定。 Then, to access a form from the second project just use this: 然后,要从第二个项目访问表单,只需使用:

Yourproject2.FormsName objName=new YourProject2.FormName(); Yourproject2.FormsName objName = new YourProject2.FormName();

objName.Show(); objName.Show();

首先添加对您的其他项目的引用,然后只需调用:

NavigationService.Navigate(new ProjectB.page());

You need to add a reference to Project A in your Project B. You can do this by RMC on a ProjectB and choosing Add reference... . 您需要在项目B中添加对项目A的引用。您可以在ProjectB上通过RMC执行此操作并选择添加引用.... Then in a new window go to Projects tab and choose Project A. After that, you can call the page in Project B: Pseudo-code: 然后在新窗口中转到Projects选项卡并选择Project A.之后,您可以在Project B中调用页面:Pseudo-code:

ProjectA.PageNamespace page = new ProjectA.PageNamespace()

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 是否可以从同一解决方案中将项目A中的一页重定向到项目B中的页面? - Is it possible to redirect from one page in Project A to a page in Project B from within the same solution? 在同一解决方案中从另一个项目中的一个项目打开xaml页面 - Open a xaml page from one project in another project in the same solution 重定向到同一解决方案中其他项目的页面 - redirect to page on a different project in same solution 重定向到同一解决方案的不同项目中的另一个页面 - Redirect to another page in different project of same solution Blazor - 在一个解决方案中重定向到另一个项目中的页面 - Blazor - redirect to page in another project in one solution 将用户控件从一个项目复制到同一解决方案中的另一个项目 - Copy User Control from one project to another within same solution 从同一解决方案中运行第二个项目 - Run a second project from within the same solution 在同一解决方案中将一个项目的照片文件用于另一个项目 - Use photo file from one project to another project in the same solution 将服务引用从一个项目复制到同一解决方案中的另一个项目 - Copy service reference from one project to another project in same solution 从同一解决方案MVC中的不同项目访问EF ConnectionString - Accessing EF ConnectionString from different project within same solution MVC
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM