Avatar of TheCommunicator
TheCommunicatorFlag for United States of America

asked on 

Loading another controller's view using MVC

Hi All,


I want to load another controller's view using MVC. I do it using something ike  return View(~/view/Controller/action);


Now this is a stringly typed view and I am using aspx pages to do that. When it loads, it says that Model is Null. How can I do this?
ASP.NETC#

Avatar of undefined
Last Comment
TheCommunicator
SOLUTION
Avatar of Irzana
Irzana
Flag of Sri Lanka image

Blurred text
THIS SOLUTION IS ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
See Pricing Options
Start Free Trial
Avatar of TheCommunicator

ASKER

can you give me an example?
ASKER CERTIFIED SOLUTION
Avatar of Irzana
Irzana
Flag of Sri Lanka image

Blurred text
THIS SOLUTION IS ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
SOLUTION
Avatar of P1ST0LPETE
P1ST0LPETE
Flag of United States of America image

Blurred text
THIS SOLUTION IS ONLY AVAILABLE TO MEMBERS.
View this solution by signing up for a free trial.
Members can start a 7-Day free trial and enjoy unlimited access to the platform.
Avatar of TheCommunicator

ASKER

Hi Guys,

Instead of doing that you have suggeste, i ended up doing something like below:

return View("~/,,,", Model)

Open in new window


That actually seemed to me like a simple solution.
ASP.NET
ASP.NET

The successor to Active Server Pages, ASP.NET websites utilize the .NET framework to produce dynamic, data and content-driven web applications and services. ASP.NET code can be written using any .NET supported language. As of 2009, ASP.NET can also apply the Model-View-Controller (MVC) pattern to web applications

128K
Questions
--
Followers
--
Top Experts
Get a personalized solution from industry experts
Ask the experts
Read over 600 more reviews

TRUSTED BY

IBM logoIntel logoMicrosoft logoUbisoft logoSAP logo
Qualcomm logoCitrix Systems logoWorkday logoErnst & Young logo
High performer badgeUsers love us badge
LinkedIn logoFacebook logoX logoInstagram logoTikTok logoYouTube logo