I’m working with referencing user controls on my ASPX page and I’m wondering what the difference is between these two page directives.
I’m working with referencing user controls on my ASPX page and I’m wondering what
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
@Registeris the more commonly used directive. You use this when you want to use a user control in your aspx or ascx page declaratively.@Registerassociates the control with a specific prefix and you can then use it in your markup.@Referenceonly tells ASP.NET to compile the other control when your aspx or ascx page is compiled. That makes sure it is available at run-time and can be added to your control hierarchy programmatically. This is less common since dynamically changing user controls at runtime is not comon.Here’s a good blog post about it.
http://weblogs.asp.net/johnkatsiotis/archive/2008/08/13/the-reference-directive.aspx