I have set default routing in razor this my code. But it's not working
- services.AddMvc().AddRazorPagesOptions(options =>
- {
- options.Conventions.AddPageRoute("/PageTemplates/_Home", "");
- });
- }
- public void Configure(IApplicationBuilder app, IWebHostEnvironment env)
- {
- if (!env.IsDevelopment())
- {
- app.UseHsts();
- }
- app.UseHttpsRedirection();
- app.UseCofoundry();
- app.UseRouting();
- app.UseEndpoints(endpoints =>
- {
- endpoints.MapRazorPages();
- });
By default Error.cshtml page run i want to run home page .Please help me
3 Replies
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Jignesh KumarPosted Mar 2, 2021, 11:40 AM
Kiran MohantyPosted Mar 2, 2021, 11:14 AM
Sachin SinghPosted Mar 2, 2021, 10:29 AM