ASP.NET ascx vs. aspx - Do you reuse user controls?

后端 未结 4 2368
孤城傲影
孤城傲影 2021-02-20 07:26

Our team is developing a rather big ASP.NET web project which initially started in ASP.NET 1.0 and was ported several times to all new versions of .NET.

We made extensiv

4条回答
  •  無奈伤痛
    2021-02-20 08:24

    It does purely come down to the type of web application which is being designed. At work one of our applications is very configurable so works on one page (default.aspx) and loads in controls depending on how its configured for the logged in user.

    However, on the flip side, if you are writing a web site which needs to be accessed through SEO and has to be easy to navigate then implementing each view in an aspx page is a good way. Makes accessing each page during development easy and straight forward as you can access it directly (assuming no security permissions / logic get in the way) through setting it as your start up page in VS.

    Another option to throw into the mix is using ASP.net MVC; interdependant views with re-usable usercontrols also thrown into the mix :-)

提交回复
热议问题