Can't Find WorkflowConfigurationData object in ascx

Jul 29, 2009 at 3:20 PM
Edited Jul 29, 2009 at 3:20 PM

I have just started using this and I can't seem to get past the point were I added the WorkflowConfigurationData and User Control for the assoc and init.  I've added the imports and assembly references but it still can't find my data class.  If I drop the DLL into the GAC is suddenly works but I should be able to get design time support before dropping it into the gac.  Any ideas?

<%@ Control Language="C#" AutoEventWireup="true" Inherits="TPG.SharePoint.Workflow.ConfigurationControl, TPG.SharePoint.Workflow, Version=1.0.0.0, Culture=neutral, PublicKeyToken=d3a33f5f62ef53ef" %>
<%@ Register TagPrefix="tpg" Namespace="TPG.SharePoint.Workflow.Controls" Assembly="TPG.SharePoint.Workflow, Version=1.0.0.0, Culture=neutral, PublicKeyToken=d3a33f5f62ef53ef" %>
<%@ Assembly Name="TPG.SharePoint.Workflow, Version=1.0.0.0, Culture=neutral, PublicKeyToken=d3a33f5f62ef53ef" %>
<%@ Assembly Name="SharePointWF.DocApprovalAndPublish, Version=1.0.0.0, Culture=neutral, PublicKeyToken=30d511161ec4ebed" %>
<%@ Import Namespace="TPG.SharePoint.Workflow" %>
<%@ Import Namespace="SharePointWF.DocApprovalAndPublish" %>

<tpg:InputForm runat="server">
    <tpg:InputFormSection runat="server" 
      Title="My Section" 
      Description="This is the section subtitle">
        <ContentTemplate>
            <tpg:InputFormControl runat="server" 
              LabelText="MyField" 
              ExampleText="abcdefg">
                <ControlTemplate>
                    <asp:TextBox ID="MyConfigurationField" runat="server" Width="100%" />
                </ControlTemplate>
            </tpg:InputFormControl>
        </ContentTemplate>
    </tpg:InputFormSection>
    <tpg:ButtonSection runat="server" ShowStandardCancelButton="false">
        <ButtonTemplate>
            <asp:Button runat="server" Text="OK" CommandName="Commit" />
            <asp:Button runat="server" Text="Cancel" CommandName="Cancel" />
        </ButtonTemplate>
    </tpg:ButtonSection>
</tpg:InputForm>

<script type="text/C#" runat="server">
    protected override void LoadData(bool isInitialLoad)
    {
        if (isInitialLoad)
        {
            WorkflowConfigurationData configData = GetDataAs<WorkflowConfigurationData>();

            if (configData != null)
            {
              MyConfigurationField.Text = configData.MyField;
            }
        }
    }

    protected override ConfigurationData SaveData(object commandArgument)
    {
        WorkflowConfigurationData configData = new WorkflowConfigurationData();
        configData.MyField = MyConfigurationField.Text;
        return SaveDataAs<WorkflowConfigurationData>(configData);
    }   
</script>

Coordinator
Jul 29, 2009 at 3:25 PM

You don't get design time support until you drop your assembly into the GAC or the TPG.SharePoint.Workflow assembly in the GAC?

Jul 29, 2009 at 3:29 PM

Thanks for the quick reply.

TPG.SharePoint.Workflow is already in my GAC.  I would have thought that as changed/added properties in the Data class, I would be able to reference them and get intellisense in my ascx without deploying to the gac just to see the new properties.  Does that sound right?

Your sample project works fine and it has not been deployed to the gac.

Jul 29, 2009 at 3:31 PM

I am trying to use this with WSPBuilder but I don't think that should cause any issues.

Coordinator
Jul 29, 2009 at 3:40 PM

If you remove all the code from the ascx as well as the references to your assemblies does it load in the designer?  If that doesn't work, can you restart VS and see if it works?

Jul 29, 2009 at 3:48 PM

It did not initally work because it was looking for the ascx file in the root of the project rather then in my CONTROLTEMPLATES folder.  Not sure why but I moved it back to the root and it was able to show the designer.  I put back the script and the references and it still goes into the designer but it still can't find the data class.

Coordinator
Jul 31, 2009 at 2:03 PM

Sorry for the delay in getting back to you.  So if I understand the problem at this point, if you move it to the root of the project, the designer works but no matter where it is there are problems finding the data class.  Also it sounds like the sample project is working fine?

If this is the case, could you email me your project at predeekc at hotmail?

Dec 9, 2009 at 11:47 AM

I am following the video tutorial on SimpleApprovalWorkflow.When I add configuration control,I am not getting  reference for WorkflowConfigurationData in WorkFlowConfiguration.ascx.Can you guide on this?

Dec 9, 2009 at 1:05 PM

what I found was that the ascx file needs to be in the root folder of the project rather then in a folder like CONTROLTEMPLATES that you want to deploy it to.  So if I have a structure of folders like <project root>\12\Template\ControlTemplates and I put the ascx in the ControlTemplates folder it won't work during design time.  It will work in that folder once its released.  Just move the ascx to the <project root> folder and it might work - it did for me.  Any time I need to make a change I move it to the root and then when I'm done I put it back into controltemplates and deploy it.

I haven't used this for a few months - always getting sidetracked - but I'm pretty sure that's what worked for me.

Mar 15, 2010 at 3:18 PM

Hi,

the ascx control can't find the corresponding data class (ReleaseplanningConfigurationControlData). I already added the requierd assembly reference and namespace to the ascx control. My assembly and TPG.SharePoint.Workflow are deployed to the GAC.

Have you any ideas? Thanks in advance.


<%@ Control Language="C#" AutoEventWireup="true" Inherits="TPG.SharePoint.Workflow.ConfigurationControl, TPG.SharePoint.Workflow, Version=1.0.0.0, Culture=neutral, PublicKeyToken=d3a33f5f62ef53ef" %>
<%@ Register TagPrefix="tpg" Namespace="TPG.SharePoint.Workflow.Controls" Assembly="TPG.SharePoint.Workflow, Version=1.0.0.0, Culture=neutral, PublicKeyToken=d3a33f5f62ef53ef" %>
<%@ Assembly Name="TPG.SharePoint.Workflow, Version=1.0.0.0, Culture=neutral, PublicKeyToken=d3a33f5f62ef53ef" %>
<%@ Import Namespace="TPG.SharePoint.Workflow" %>
<%--add assembly reference here--%>
<%--<%@ Assembly Name="MyWorkflowLibrary, Version=1.0.0.0, Culture=neutral, PublicKeyToken= " %>--%>
<%@ Assembly Name="Releases, Version=1.0.0.0, Culture=neutral, PublicKeyToken=9f4da00116c38ec5" %>
<%@ Import Namespace="Releases" %>

[...]

<script type="text/C#" runat="server">
    protected override void LoadData(bool isInitialLoad)
    {
        if (isInitialLoad)
        {
            ReleaseplanningConfigurationControlData configData = GetDataAs<ReleaseplanningConfigurationControlData>();

            if (configData != null)
            {
              MyConfigurationField.Text = configData.MyField;
            }
        }
    }

    protected override ConfigurationData SaveData(object commandArgument)
    {
        ReleaseplanningConfigurationControlData configData = new ReleaseplanningConfigurationControlData();
        configData.MyField = MyConfigurationField.Text;
        return SaveDataAs<ReleaseplanningConfigurationControlData>(configData);
    }   
</script>
Coordinator
Mar 15, 2010 at 6:07 PM

Can you check the data class. In our previous release there was a bug where the data class was called something like ConfigurationDataData. You can rename the class if this is the case.

Best regards,

Wouter van Vugt
MVP Visual Studio Tools for Office

Envelope

wouter@code-counsel.net

Telephone

+31 6  438 317 12

icon_twitter

@woutervugt

RSS

http://blogs.code-counsel.net/wouter

Logo 7 cm

Code Counsel

Critical Path Training

CPT

Sharing Knowledge with Passion
www.code-counsel.net

Your fastest way up the SharePoint learning curve!
www.criticalpathtraining.com

From: awaiK [mailto:notifications@codeplex.com]
Sent: maandag 15 maart 2010 16:19
To: Wouter van Vugt
Subject: Re: Can't Find WorkflowConfigurationData object in ascx [wss3workflow:63879]

From: awaiK

Hi,

the ascx control can't find the corresponding data class (ReleaseplanningConfigurationControlData). I already added the requierd assembly reference and namespace to the ascx control. My assembly and TPG.SharePoint.Workflow are deployed to the GAC.

Have you any ideas? Thanks in advance.

<%@ Control Language="C#" AutoEventWireup="true" Inherits="TPG.SharePoint.Workflow.ConfigurationControl, TPG.SharePoint.Workflow, Version=1.0.0.0, Culture=neutral, PublicKeyToken=d3a33f5f62ef53ef" %>
<%@ Register TagPrefix="tpg" Namespace="TPG.SharePoint.Workflow.Controls" Assembly="TPG.SharePoint.Workflow, Version=1.0.0.0, Culture=neutral, PublicKeyToken=d3a33f5f62ef53ef" %>
<%@ Assembly Name="TPG.SharePoint.Workflow, Version=1.0.0.0, Culture=neutral, PublicKeyToken=d3a33f5f62ef53ef" %>
<%@ Import Namespace="TPG.SharePoint.Workflow" %>
<%--add assembly reference here--%>
<%--<%@ Assembly Name="MyWorkflowLibrary, Version=1.0.0.0, Culture=neutral, PublicKeyToken= " %>--%>
<%@ Assembly Name="Releases, Version=1.0.0.0, Culture=neutral, PublicKeyToken=9f4da00116c38ec5" %>
<%@ Import Namespace="Releases" %>
 
[...]
 
<script type="text/C#" runat="server">
    protected override void LoadData(bool isInitialLoad)
    {
        if (isInitialLoad)
        {
            ReleaseplanningConfigurationControlData configData = GetDataAs<ReleaseplanningConfigurationControlData>();
 
            if (configData != null)
            {
              MyConfigurationField.Text = configData.MyField;
            }
        }
    }
 
    protected override ConfigurationData SaveData(object commandArgument)
    {
        ReleaseplanningConfigurationControlData configData = new ReleaseplanningConfigurationControlData();
        configData.MyField = MyConfigurationField.Text;
        return SaveDataAs<ReleaseplanningConfigurationControlData>(configData);
    }   
</script>

Read the full discussion online.

To add a post to this discussion, reply to this email (wss3workflow@discussions.codeplex.com)

To start a new discussion for this project, email wss3workflow@discussions.codeplex.com

You are receiving this email because you subscribed to this discussion on CodePlex. You can unsubscribe or change your settings on codePlex.com.

Please note: Images and attachments will be removed from emails. Any posts to this discussion will also be available online at codeplex.com

Mar 16, 2010 at 8:02 AM

Hi,

today, after a shutdown about 10 hours of my pc, the data class is recognized.
I don't know whats different compared to yesterday, but it works now, thanks.

May 14, 2010 at 12:12 PM

If you use WSPBuilder you should not just drag and drop you ascx control to the forlders for controltemplates. You should go to your folder in your soultion right-click and select "Add existing item" then just find your ascx file and add it, if not it seems like WSPBuilder can't find the file.

Jul 1, 2010 at 3:18 AM

fought with this again for like 2 hours.  Finally tried a WSPBuilder Build and now it can find my data class.