when do you need .ascx files and how would you use them?

后端 未结 7 964
攒了一身酷
攒了一身酷 2020-12-07 15:27

When building a website, when would it be a good idea to use .ascx files? What exactly is the .ascx and what is it used for? Examples would help a lot thanks!

7条回答
  •  一生所求
    2020-12-07 15:56

    If you have a block of code+html that appears on several pages and is sort of independent of that page (say a block of latest news items), you could copy/paste the code to every page.

    It is however better to put that code in its own block and just include that block on every page that needs it. That "block" is an ascx file.

提交回复
热议问题