I created my own custom date picker consisting of an ASP TextBox, Button, and Calendar complete with CSS styles, javascript code, and event handling vb code.
I want to use this date picker multiple times on my form. I know the wrong way to do this would be to copy all the code and just adjust each name accordingly.
How can I put those controls, styles, an开发者_StackOverflow社区d code into a single entity?
Make a user control (.ascx) out of your controls and use it as many times as you need on your form.
More on user controls:
ASP.NET User Controls Overview http://msdn.microsoft.com/en-us/library/fb3w5b53.aspx
Walkthrough: Creating Reusable Elements with ASP.NET User Controls http://msdn.microsoft.com/en-us/library/3457w616.aspx
精彩评论