'Scaffolding Layout file for Identity in .Net 6.0

When scaffolding Identity Pages for a .Net 6.0 project the Layout page does not get scaffolded. I tried scaffolding via UI in Visual Studio, and via the command line:

dotnet aspnet-codegenerator identity --layout "/Areas/Identity/Pages/Shared/_Layout.cshtml" --force

Both don't generate a Layout file. How can I scaffold the layout file?



Solution 1:[1]

Just scaffold a page. You don't have to change it. I scaffolded in the Login page for example. _Layout.cshtml appears in the folder \Pages\Shared.

enter image description here

enter image description here

enter image description here

enter image description here

enter image description here

Solution 2:[2]

First of all, you need to be using discord.py version 2.0.0 for this to work.

To add buttons to a message, you first have to create a view, and then add this view to the message you want to send:

class DeleteEmbedView(discord.ui.View):
    @discord.ui.button(label='I joined', style=discord.ButtonStyle.green)
    async def delete(self, button: discord.ui.Button, interaction: discord.Interaction):
        # This is called once the button is clicked
        await interaction.message.delete() #delete the message with the embed
        # delete it from the JSON file here

and then whenever you want to send the button with the message do:

await channel.send(embed=embed, view=DeleteEmbedView())

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1
Solution 2 Chuaat