Different ways to reuse code in asp.net


We have different way to Add or Reuse Files and code in asp.net.

1. Use Master Page in 2.0  (Recommended)

2. Master Page+ User Control (easy to maintain)
(Better for when change header or footer or specific part of content on runtime)  hide user control runtime

3. User Control with .aspx page

4. <!--#include file="inc_footer.aspx"--> classic asp style

5. Add Inc File Response.WriteFile ("my.inc")

6. Frame and iFrame (HTML Style) always prefer iframe (you can add html,aspx,php etc. in this style) and never try frame because it not support some browsers. -HTML Style

7. One of the way to add content on client side is Ajax using div tag also good use xmlhttprequest object (content change without refresh on client side) - Ajax Style

Comments