TECHNOLOGIES
FORUMS
JOBS
BOOKS
EVENTS
INTERVIEWS
Live
MORE
LEARN
Training
CAREER
MEMBERS
VIDEOS
NEWS
BLOGS
Sign Up
Login
No unread comment.
View All Comments
No unread message.
View All Messages
No unread notification.
View All Notifications
Answers
Post
An Article
A Blog
A News
A Video
An EBook
An Interview Question
Ask Question
Forums
Monthly Leaders
Forum guidelines
Aakash N
NA
166
19.7k
.Net Core Call controller from another controller [Areas]
Jan 10 2019 2:41 PM
In my ASP.Net Core 2.1 solution(layout) I have areas as projects with its own controllers. On the layout solution home controller, I'm setting the session variables on Sql Server. and using session variables on areas where the data gets loaded. This is to avoid duplicating session logic on areas
In this case, I'm trying to launch area controller as startup and want to make areas controller wait until layout controller is ready with session variables set on Sql Server.
current routing on startup.cs
app.UseMvc(routes =>
{
routes.MapRoute(
name:
"area"
,
template:
"{area:exists}/{controller=Area1Home}/{action=Index}/{id?}"
);
routes.MapRoute(
name:
"default"
,
template:
"{controller=Home}/{action=Index}/{id?}"
);
});
How can I make an area controller load on startup(landing page)?
Also, how can I make a make an area controller dependent on layout controller so that the application doesn't throw an error because session variables are not available to area controllers to load data? Or
Is there a way to make area controller wait until the home controller is loaded?
Reply
Answers (
0
)
How to change file Upload default "Browse" wriiten name
Generate Client Token in ASP.NET MVC