Friday, February 12, 2010

How to write code in order to create custom control on asp.net?

i am new to asp.net.I have to write programe for custom custom control.How to write code in order to create custom control on asp.net?
You need to create a .ascx file. In this file you are going to lay out the html portion of the control just as you would in any .aspx file and then code it the same way you would your .aspx file.


Now when you want to use it you need to register it. This is also really simple. You need to write out a tag kind of like this one:


%26lt;% Register TagPrefix=';my'; TagName=';control'; Src=';.\myControl.ascx'; %%26gt;


You can name 'TagPrefix' and 'TagName' just about anything you want, and 'Src' is the path to the control. And now to actually use it:


%26lt;my:control id=';myId'; runat=';server'; other stuff /%26gt;How to write code in order to create custom control on asp.net?
take a look at this page


I hope that this can help you


http://www.ondotnet.com/pub/a/dotnet/exc鈥?/a>


Gennerally, o'reilly books are good.

1 comment: