none
Invoking Asp.Net core web page from existing asp.net web application

    Question

  • Hi Team,

    I'm working on a project(Web application) which is on Asp.net and few pages are in asp.

    we are planning to move few pages to Asp.Net Core.

    Request you to guide us on how to navigate from Existing Web application to new Asp.Net core page and what are the configuration chnages required for the same.

    Thanks,

    Reshma V

    Friday, May 17, 2019 2:13 PM

All replies

  • Well, you asked the question in the C# forum, but in principle no changes are needed on the C# side. To navigate from an existing application to the new one you would just add to your page a navigation link with an absolute address pointing to the location where you installed the new application.

    If you have additional requirements, such as sharing the Session or the Login, then it will be much more complex. But if it's just navigation, simply use a link pointing to the new address. No configuration changes are needed in either application.

    Friday, May 17, 2019 3:48 PM
  • ASP.NET Core does not support ASP.NET Web forms. You will have to learn how to use ASP.NET MVC Core. You can discuss ASP.NET in the ASP.NET forums. 

    http://forums.asp.net/

    Friday, May 17, 2019 3:55 PM
  • Hi Remshma,

    Thank you for posting here.

    Since this thread is related to asp.net , you could post in the following forum.

    https://forums.asp.net/​​​​​​​

    The Visual C# forum discusses and asks questions about the C# programming language, IDE, libraries, samples, and tools.

    Best regards,

    Jack


    MSDN Community Support
    Please remember to click "Mark as Answer" the responses that resolved your issue, and to click "Unmark as Answer" if not. This can be beneficial to other community members reading this thread. If you have any compliments or complaints to MSDN Support, feel free to contact MSDNFSF@microsoft.com.

    Monday, May 20, 2019 1:34 AM
  • you mean changing to ABCLink.NavigateUrl = "/Home/Index"; should work?

    How will existing project identify new project?

    thanks

    Tuesday, May 21, 2019 4:27 AM
  • you mean changing to ABCLink.NavigateUrl = "/Home/Index"; should work?

    How will existing project identify new project?

    No, te project is irrelevant. This is for the benefit of the Browser, which will navigate to the indicated page regardless of the project in which it was coded. The projects disappear once you publish the application, only the addresses of the pages are significant at that time.

    If you write the page as "/Home/Index", then the browser will navigate to that address under the same server. For example, if you publish ProjectA at myserver.com/MyProject1, and you publish ProjectB as myserver.com/MyProject2, then when you use the address /MyProject2/Home/Index in ProjectA the browser will navigate to myserver.com/MyProject2/Home/Index, which coincidentally will happen to be processed by your ProjectB, which is the one that you configured to serve that address.

    Note that the preceding depends on having both projects on the same server. If they are not, then you need to write a longer address so that the server can be identified: "https://myserver2.com/MyProject2/Home/Index". You will need to do this at development time if you are using the default internal server in visual studio which assigns a different port for each project. You can avoid it if you change the project so that it is debugged on IIS.

    Tuesday, May 21, 2019 5:59 AM
  • Let me try to elaborate the question.

    I have existing solution with 10 projects in asp.net web application.

    now am trying to add a new ASP.NET Core project to it.

    expectation is assume there is button in web page, on click that button I need to navigate to my new ASP.net core web page.

    I have registered routes in Global.aspx.cs file, and ABC(ButtonId).NavigateUrl= /Home/Index.

    how does my existing web application know that it needs to navigate to Aspcore proj and Home controller.

    is there anything I missed any references is required?

    Tuesday, May 21, 2019 6:35 AM
  • No. It won't work that way. The two applications will not be able to "understand" each other, so you will need to establish the connections manually.

    The first thing to understand is that the mere fact that you added both projects to the same solution is completely useless at runtime. The solution will not do anything to "connect" them. You need to consider how you will deploy each project, so that there is a known relationship between their addresses that you can exploit at runtime. Merely navigating to "/Home/Index" is not enough. You have to use "/something/Home/Index", and carefully choose that "something" so that it matches your deployment configuration. It's not enough to think only about your solution structure at development time. This is not automatically mapped to a Url hierarchy at runtime.

    Tuesday, May 21, 2019 11:24 AM
  • Let me try to elaborate the question.

    I have existing solution with 10 projects in asp.net web application.

    now am trying to add a new ASP.NET Core project to it.

    expectation is assume there is button in web page, on click that button I need to navigate to my new ASP.net core web page.

    I have registered routes in Global.aspx.cs file, and ABC(ButtonId).NavigateUrl= /Home/Index.

    how does my existing web application know that it needs to navigate to Aspcore proj and Home controller.

    is there anything I missed any references is required?

    Why are you asking these questions in the C# forum when they should be asked in the ASP.NET Core forum, ASP.NET MVC forum and ASP.NET Web forum in ASP.NET forums?

    And you would have to be doing some kind of HTTPGet on a MVC ActionResult in a controller  to even have a  MVC view show up.

    The horse can be lead to the water, but it's up to the horse to take the drink.

    http://forums.asp.net/


    • Edited by DA924x Tuesday, May 21, 2019 1:42 PM
    Tuesday, May 21, 2019 1:41 PM