Smile Azeez
Smile Azeez

Reputation: 147

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. I want use a page of Project A in Project B. How to call that page from Project B. Thanks in advance.

Upvotes: 0

Views: 387

Answers (3)

Muhamed Shafeeq
Muhamed Shafeeq

Reputation: 1214

Its possible to acceess another solution forms you have 2 projects in the same solution.

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.

Click OK. Then, to access a form from the second project just use this:

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

objName.Show();

Upvotes: 1

Mitch
Mitch

Reputation: 191

First add a reference to your other project, then just call:

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

Upvotes: 1

niao
niao

Reputation: 5070

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... . 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:

ProjectA.PageNamespace page = new ProjectA.PageNamespace()

Upvotes: 0

Related Questions