Advertisement
Help Keep Boards Alive. Support us by going ad free today. See here: https://subscriptions.boards.ie/.
If we do not hit our goal we will be forced to close the site.

Current status: https://keepboardsalive.com/

Annual subs are best for most impact. If you are still undecided on going Ad Free - you can also donate using the Paypal Donate option. All contribution helps. Thank you.
https://www.boards.ie/group/1878-subscribers-forum

Private Group for paid up members of Boards.ie. Join the club.

Problems deploying a Sharepoint Custom web part

  • 05-03-2008 11:39AM
    #1
    Registered Users, Registered Users 2 Posts: 2,793 ✭✭✭


    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, Registered Users 2 Posts: 2,931 ✭✭✭Ginger


    Your namespace is NewWepPart rather than NewWebPart..

    Check that


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


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

    Check that

    You're right :o

    Thanks for the help!


Advertisement