I'm trying to call a user control (.ascx) in a client web part that I've created, knowing that I need to do that in a provider hosted app. Can someone give me a helpful tutorial please? What should I make in the client web part to call the page.ascx ?


Yes. First you should register the ascx file in the Markup of your webpart

<%@ Register Src="~/_controltemplates/15/Folder/Page.ascx" TagPrefix="uc1" TagName="PageAscx" %>

Then add the control using

<uc1:PageAscx runat="server" id="PageUC1" />
| improve this answer | |
  • thanks Hashim ,but should I put both of this lines in the my webpart.aspx ?? – N.Sahraoui Apr 17 '15 at 14:25
  • Yes. Both line goes into your web part markup – Amal Hashim Apr 17 '15 at 14:31

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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