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
Hi there,
There is an issue with role permissions that is being worked on at the moment.
If you are having trouble with access or permissions on regional forums please post here to get access: https://www.boards.ie/discussion/2058365403/you-do-not-have-permission-for-that#latest

Problems deploying a Sharepoint Custom web part

  • 05-03-2008 10: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