Advertisement
If you have a new account but are having problems posting or verifying your account, please email us on hello@boards.ie for help. Thanks :)
Hello all! Please ensure that you are posting a new thread or question in the appropriate forum. The Feedback forum is overwhelmed with questions that are having to be moved elsewhere. If you need help to verify your account contact hello@boards.ie

Problems deploying a Sharepoint Custom web part

Options
  • 05-03-2008 11:39am
    #1
    Registered Users Posts: 2,791 ✭✭✭


    Hi,

    I have compiled a simple web part to get me familiar with programming in MOSS2007.

    The code itself is very simple and compiles into NewWebPart.Dll no problem:
    using System;
    using System.Collections.Generic;
    using System.Text;
    using System.Web;
    using System.Web.UI;
    using System.Web.UI.WebControls;
    using System.Web.UI.WebControls.WebParts;
    
     
    
    namespace NewWepPart
    
    {
        public class NewWebPart : WebPart
    
        {
            protected override void CreateChildControls()
    
            {
    
                Calendar cldr = new Calendar();
                cldr.Enabled = true;
                cldr.ShowGridLines = true;
                cldr.ShowTitle = true;
                cldr.EnableViewState = true;
                cldr.SelectedDate = DateTime.Now;
                Controls.Add(cldr);
    
            }
    
            public override void RenderControl(HtmlTextWriter writer)
    
            {
                RenderChildren(writer);
    
            }
        }
    }
    

    I have added [assembly: AllowPartiallyTrustedCallers] to the Assembly file and given it a strong name.

    I have dropped the compiled .DLL file into the C:Windows/Assemblies folder

    I then added the following to the web config file:

    <SafeControl Assembly="NewWebPart, Version=1.0.0.0, Culture=neutral, PublicKeyToken=fad64bfb23c23e02" Namespace="NewWebPart" TypeName="*" Safe="True" />

    Finally, I did an IIS reset but the web part is not showing up in the WebPart Gallery->New page

    Any suggestions?


Comments

  • Registered Users Posts: 2,931 ✭✭✭Ginger


    Your namespace is NewWepPart rather than NewWebPart..

    Check that


  • Registered Users Posts: 2,791 ✭✭✭John_Mc


    Ginger wrote: »
    Your namespace is NewWepPart rather than NewWebPart..

    Check that

    You're right :o

    Thanks for the help!


Advertisement