Thursday, 23 December 2021

How To Change Default Page Or View In Asp.Net Core 6

12/23/2021 - By Pranav Singh 0

In  this article i will show you how you can set the default page or default view in your asp.net core 6 application. So this first we will crate a new asp.net core application. Now run the application and then currently set default page. 


How To Change Default Page In Asp.Net Core 6

Now we will make change in our code to set other default page. For this first we will open our Startup.cs file. In this file we need to add the below code under Configure.


    app.UseEndpoints(endpoints =>

            {

                endpoints.MapControllerRoute(

                    name: "default",

                    pattern: "{controller=Home}/{action=Index}/{id?}");

            });        }


 In above code you need to make changes. Here you need to add the controller name and action or view name which you want to make default. Now lets check the output.


default page in .net core

About the Author

We are the group of people who are expertise in different Microsoft technology like Asp.Net,MVC,C#.Net,VB.Net,Windows Application,WPF,jQuery,Javascript,HTML. This blog is designed to share the knowledge.

Get Updates

Subscribe to our e-mail newsletter to receive updates.

Share This Post

0 comments:

Please let me know your view

Free Ebooks


About Us

We are the group of people who are expertise in different Microsoft technology like Asp.Net,MVC,C#.Net,VB.Net,Windows Application,WPF,jQuery,Javascript,HTML. This blog is designed to share the knowledge.

Contact Us

For writing article in this website please send request by your

GMAIL ID: dotnetpools@gmail.com

Bugs and Suggestions

As we all know that this website is for sharing knowledge and providing proper solution. So while reading the article is you find any bug or if you have any suggestion please mail us at contact@aspdotnet-pools.com.

Partners


Global Classified : Connectseekers.com
© 2014 aspdotnet-pools.com Designed by Bloggertheme9.
back to top