replace the start page with another page

Saturday, May 25, 2024 9:52:39 AM
  • Posted: Friday, December 9, 2022 3:31 PM
  • 3
Hello, I want to replace the start page index with another page (I couldn't find the startup.cs file) how can I do it? thanks
0
  • Posted: Friday, December 9, 2022 8:05 PM
  • 3

Hello,

Which page and line should I write the code below?

I want the first opening start page to be opened as "MainPage" that I created in the default controls

Waiting for your reply, thank you very much


        public static void RegisterRoutes(RouteCollection routes)
        {
            routes.MapRoute(
        name: "SomeDescriptiveName",
        template: "AnotherNameThatPointsToHome/{action=MainPage}/{id?}",
        defaults: new { controller = "Default" }
    );
        }
0
  • Posted: Saturday, December 10, 2022 4:04 PM
  • 3
Hello, where should I write the following redirect code?


public class Startup
    {
        public Startup(IConfiguration configuration)
        {
            Configuration = configuration;

        }
        public IConfiguration Configuration { get; }

        public void ConfigureServices(IServiceCollection services)
        {
            services.AddMvc();
        }

        public void Configure(IApplicationBuilder app, IWebHostEnvironment env)
        {
            app.UseRouting();
            app.UseMvc(Routes =>
            {
                Routes.MapRoute(

                     name: "default",
                     template: "{controller=Default}/{action=MainPage}/{id?}");
            });
        }
    }
0
back to top
Filters