1

I am working on project in that some pages are in Web Form (Asp.net) and some pages are in MVC (Asp.net MVC view)

I want to navigate Web From to Mvc View & vise versa

Project Structure

enter image description here

I want to redirect Asp.net Master page to Mvc Controller

enter image description here

Redirection coder is bellow,

enter image description here

It will not working ,How can I achieve this functionality

shivani
  • 980
  • 1
  • 8
  • 29
  • As you are trying to redirect to another project, you need to provide whole path.Currently it is not able to hit the index method of adduser controller because it is placed in another project. – Deepankshee Jain Mar 29 '19 at 09:32
  • how can I achieve it i am not able to understand – shivani Mar 29 '19 at 09:36
  • If there any way to combine asp.net [web form] & asp.net [MVC] application in single project ? – shivani Mar 29 '19 at 09:37
  • yes you can combine both projects in single project you just need to placeyour controller folder in web form project and need to add references for MVC in that project. It wil work. If you don't want to do that then please specify whole path in href link like href="localhost:3456//adduser/index" something like that. – Deepankshee Jain Mar 29 '19 at 09:49
  • Yes that I do it , I add Mvc project reference in web form project , but my concern is that how can I call mvc view from web form – shivani Mar 29 '19 at 09:51
  • 1
    You can visit below link.There is very clear explanation there.Check and let us know if it helps you. https://stackoverflow.com/questions/2203411/combine-asp-net-mvc-with-webforms – Dilip Oganiya Mar 30 '19 at 05:38

1 Answers1

0

I guess you are trying to write razor view syntax in webforms which is not going to work.

You can combine both webforms and MVC in a single project.

enter image description here

<a href="~/WebForm1.aspx">Redirect to Webform</a>

in your MVC view to redirect to webforms.

and

<a href="Home/Index">Redirect Now</a> 

from webfroms to MVC

Jitan Gupta
  • 454
  • 6
  • 18
  • "The resource cannot be found" :- error come with this senario – shivani Mar 29 '19 at 10:05
  • It is possible to combine aspx [asp.net] master page use in mvc [ view ] ? user common master page for aspx & mvc – shivani Mar 29 '19 at 10:41
  • I don't think it is possible to use "user control" in both WebForms and MVC, as both use different view engine (aspx view engine and razor view engine). – Jitan Gupta Mar 29 '19 at 11:00
  • 2
    You can visit below link.There is very clear explanation there.Check and let us know if it helps you. https://stackoverflow.com/questions/2203411/combine-asp-net-mvc-with-webforms – Dilip Oganiya Mar 30 '19 at 05:38