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

后端 未结 7 961
攒了一身酷
攒了一身酷 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 16:04

    When you are building a basic asp.net website using webcontrols is a good idea when you want to be able to use your controls at more then one location in your website. Separating code from the layout ascx files will be holding the controls that are used to display the layout, the cs files that belong to the ascx files will be holding the code that fills those controls.

    For some basic understanding of usercontrols you can try this website

提交回复
热议问题