ajax smart part

Aug 18, 2010 at 3:17 PM

I'm trying to use the ajax smartpart and it doesn't seem to be working at all for me. I have the two entries in the web.config:

<SafeControl Assembly="ReturnOfSmartPart, Version=, Culture=neutral, PublicKeyToken=9f4da00116c38ec5" 
                   Namespace="SmartPart" TypeName="*" Safe="True" />
      <SafeControl Assembly="ReturnOfSmartPart, Version=, Culture=neutral, PublicKeyToken=9f4da00116c38ec5" 
                   Namespace="SmartPart" TypeName="AJAXSmartPart" Safe="True" />

My Error on a moss07 webpart page:

SmartPart with AJAX

SmartPart with AJAX Web Part Menu
Error: unable to load ~\/UserControls\AJaxSmartPart.ascx
Details: Could not load type 'Company.AJaxSmartPart1.AJaxSmartPart'.

My code:

<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="AJaxSmartPart.ascx.cs" Inherits="Company.AJaxSmartPart1.AJaxSmartPart" %>

<asp:UpdatePanel ID="UpdatePanel1" runat="server">
        <asp:Button ID="btnClick" runat="server" onclick="btnClick_Click" 
            Text="Test AJAX SmartPart" />
        <br />
        <br />
        <asp:Label ID="lblbtntxt" runat="server" Text="Click Above Button"></asp:Label>
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace Company.AJaxSmartPart1
    public partial class AJaxSmartPart : System.Web.UI.UserControl
        protected void Page_Load(object sender, EventArgs e)


        protected void btnClick_Click(object sender, EventArgs e)
            lblbtntxt.Text = "The SmartPart and ASP.NET AJAX are working.";

Not working at all; why not?
Aug 18, 2010 at 10:05 PM

This has probably been mentioned before, but instead of using "CodeBehind" use "CodeFile" if you want to used CodeBehind you need to install the assembly in the GAC. That is way it can not load it.