• Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint
Share this Page URL
Help

Chapter 5. Understanding User Controls > Using the LoadControl Method

Using the LoadControl Method

One more very cool feature of User controls (and a major yucky of SSIs) is that they can be dynamically loaded with logic. This isn’t to say that you can’t dynamically execute the code in SSIs. This you can do as follows:

<%if var = 1 then%> 
<!--#include file="file1.inc" --> 
<%else%> 
<!--#include file="file2.inc" --> 
<%end if%> 


PREVIEW

                                                                          

Not a subscriber?

Start A Free Trial


  
  • Creative Edge
  • Create BookmarkCreate Bookmark
  • Create Note or TagCreate Note or Tag
  • PrintPrint