Friday, September 4, 2009

Turning an .ascx User Control into a Redistributable Web Control



As mentioned in the article above, we can turn the user control in to custom control. Please follow the following steps for the same;

ü       Create the user control

ü       Put in the stand alone visual studio web project and add the required dlls referencing the user control.

ü       Publish the web site

ü       Deselect "Allow this precompiled site to be updatable”

ü       Select "Use fixed naming and single page assemblies”

ü       This would result a dll file. Add this dll file in the CSTools or Veriphy web application’s bin folder

ü       Reference the user control in the aspx file like below;

<%@Register TagPrefix="YourControl" Namespace="ASP" Assembly="App_Web_yourcontrol.ascx.cdcab7d2"%>


There is small glitch here; the Namespace should always be “ASP”.


ü       Add the control on the page.

  < YourControl:devicenotification_ascx id="groupDeviceNotification" runat="server"/>


Hope this helps.


Thanks & Regards,

Arun Manglick || Senior Tech Lead



No comments:

Post a Comment