Check these:
1.  The .ascx file should contain something like this in its first line

<%@ Control Language="C#" AutoEventWireup="true"
Inherits="YourNamespace.MoreNamespace.YourUserControl"
CodeBehind="YourUserControl.ascx.cs" %>

2.  The namespace of your code file needs to match the namespace specified
in the .ascx
3.  You code file needs to inherit from System.Web.UI.UserControl

probably more to it - but that's all I can think of at the moment.

Sezai

On Tue, Oct 28, 2008 at 3:24 PM, Trevor Andrew <[EMAIL PROTECTED]>wrote:

>  Hi All,
>
>
>
> I've got a custom edit form ASCX which includes an SPDataSource and
> SPGridView control. We have a number of methods that respond to the OnInit
> method of the SPDataSource originally ...
>
>
>
> We've got all this going using a "codefile" distributed with the ASCX, but
> we'd obviously prefer to distribute the code as a GACable assembly ... We've
> been able to create the class, reference it using an Assembly directive
> within the ASCX control, but we don't seem to be able to directly reference
> the methods in the assembly from the "inline" event attributes within the
> markup of the ASCX control. For example, in the SPDataSource definition, we
> have an OnInit attribute:
>
>
>
>                                     OnInit=" onDsImagesOnInit"
>
>
>
> When the code was in the codefile associated with the ASCX this all worked
> fine. We've tried a number of combinations such as qualifying the method
> name with the assembly name, the namespace qualified assembly name ... but
> we always get the same sort of error message:
>
>
>
> 'ASP.editxxx_ascx' does not contain a definition for 'assemblyName' and no
> extension method 'assemblyName' accepting a first argument of type
> 'ASP.editxxx_ascx' could be found (are you missing a using directive or an
> assembly reference?)                C:\Program Files\Common Files\Microsoft
> Shared\Web Server Extensions\12\template\layouts\SPControls\xxx.ascx
>
>
>
> Any thoughts on the correct approach for this would be much appreciated
>
>
>
> Cheers,
>
> Trevor
>  -------------------------------------------------------------------
> OzMOSS.com - to unsubscribe from this list, send a message back to the list
> with 'unsubscribe' as the subject.
> Powered by mailenable.com



------------------------------------------------------------------- OzMOSS.com 
- to unsubscribe from this list, send a message back to the list with 
'unsubscribe' as the subject.
Powered by mailenable.com

Reply via email to