none
how to load a asp.net user control in visualwebpart of sharepoint 2010

    Pertanyaan

  • Hi,

    am developing a connectable webparts using visual webpart. but instead of loading the user control which comes with the visual webpart am trying to load a web user control which i have included under ControlTemplates folder in the project. whlie rendering it is giving the following error.

    "Could not load file or assembly '$SharePoint.Project.AssemblyFullName$' or one of its dependencies. The system cannot find the file specified."

    i need a sample project or steps in detail to load the simple user control in Visual webpart template or in a webpart template.

    11 Juli 2012 8:00

Jawaban

  • include the reference to assembly in the user control .ascx page <%@ Assembly Name="WebUserControl, Version=1.0.0.0, Culture=Neutral, PublicKeyToken=cf0245fc6e6934bf"%> 


    Shilpa

    • Ditandai sebagai Jawaban oleh ShilpaRam 11 Juli 2012 13:21
    11 Juli 2012 13:21

Semua Balasan

  • Hi,

    First of all, for SharePoint 2010 questions you should use this forum: http://social.msdn.microsoft.com/Forums/en-US/sharepoint2010programming/threads.

    When you are using Visual Studio 2010, it will add the $SharePoint.Project.AssemblyFullName$ token to your files. This token is replaced automatically by the real assembly reference when the project is compiled and packaged.

    So if you find this token in the web part files, I guess you deployed it manually.

    Please try to compile and package your sharepoint solution, then deploy the WSP package.


    Cordialement/Regards,

    Ludovic Caffin
    .NET/SharePoint Consultant for A3IS.

    11 Juli 2012 9:08
  • include the reference to assembly in the user control .ascx page <%@ Assembly Name="WebUserControl, Version=1.0.0.0, Culture=Neutral, PublicKeyToken=cf0245fc6e6934bf"%> 


    Shilpa

    • Ditandai sebagai Jawaban oleh ShilpaRam 11 Juli 2012 13:21
    11 Juli 2012 13:21
  • Don't you think it would have been more elegant to mark my reply as the answer?..

    Anyway, good news this is solved.


    Cordialement/Regards,

    Ludovic Caffin
    .NET/SharePoint Consultant for A3IS.

    11 Juli 2012 13:56