Can anyone please provide steps or a link for deploying a visual webpart with custom control in sharepoint 2013?

1 Answer 1



Register the control at the top your Visual Web Part ascx file with Register tag:

<%@ Register 
Assembly="ControlsDemo, Version=, Culture=neutral, PublicKeyToken=01374ea14aa626aa" %>

where Namespace should be namespace of the control's class file.. You can get the PublicKeyToken by using Visual Studio Command Prompt and writing following command:

sn –T "Complete dll path"

Once you registered the control, you can use in your Visual Web Part as follows:

<demo:ServerNameControl runat="server" id="serverNameControl"/>

PS: Please follow Kirk Evan's following post
User Controls and Server Controls in SharePoint


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.