purpose of life is joy

NAVIGATION - SEARCH

How to : Add app_code custom control into aspx page

Some time back, I was struggling to include the custom control to a page which I have created under the app_code folder to aspx page. Manually, I have done this with tags and so on. But I couldn't register it to the page. I felt I stuck here and there is no option to do that so. But I have noticed that many places of sample application, They referred the simple custom control in their pages. Below is that simple option to refer the custom controls to your asp.net pages.

1.      Go to the aspx page design mode.

2.      Register your control with the below template

<%@ Register Assembly="__code" TagPrefix="[TagPrefix]" Namespace="Your.Namespace" %>

3.      And use the control with the below syntax

<[TagPrefix]: [TagPrefix] id=”” runat=server></<[TagPrefix]>

Now you can easily compile and referrer the custom control under app_code folder.

blog comments powered by Disqus
Protected by Copyscape Web Plagiarism Check
DMCA.com