I've created an .ascx file called GradCamp, referenced it with a macro called Form - Grad Camp, linked that to a template called Grad Camp and attempted to pull that template into a user control page called Grad camp registration.
I'm getting an error on the page when I publish it:
Error creating control (/usercontrols/Forms/GradCamp.ascx).
Maybe file doesn't exists or the usercontrol has a cache directive,
which is not allowed! See the tracestack for more information!
The tracestack spits this out:
System.Web.HttpParseException: Could not load type
'CampQuality.Web.usercontrols.Forms.GradCamp'. --->
System.Web.HttpParseException: Could not load type
'CampQuality.Web.usercontrols.Forms.GradCamp'. --->
System.Web.HttpException: Could not load type
'CampQuality.Web.usercontrols.Forms.GradCamp'.
at System.Web.UI.TemplateParser.GetType(String typeName, Boolean
ignoreCase, Boolean throwOnError)
at System.Web.UI.TemplateParser.ProcessInheritsAttribute(String
baseTypeName, String codeFileBaseTypeName, String src, Assembly
assembly)
at
System.Web.UI.TemplateParser.PostProcessMainDirectiveAttributes(IDictionary
parseData)
--- End of inner exception stack trace ---
at System.Web.UI.TemplateParser.ProcessException(Exception ex)
at System.Web.UI.TemplateParser.ParseStringInternal(String text,
Encoding fileEncoding)
at System.Web.UI.TemplateParser.ParseString(String text, VirtualPath
virtualPath, Encoding fileEncoding)
--- End of inner exception stack trace ---
at System.Web.UI.TemplateParser.ParseString(String text, VirtualPath
virtualPath, Encoding fileEncoding)
at System.Web.UI.TemplateParser.ParseFile(String physicalPath,
VirtualPath virtualPath)
at System.Web.UI.TemplateParser.ParseInternal()
at System.Web.UI.TemplateParser.Parse()
at
System.Web.Compilation.BaseTemplateBuildProvider.get_CodeCompilerType()
at
System.Web.Compilation.BuildProvider.GetCompilerTypeFromBuildProvider(BuildProvider
buildProvider)
at
System.Web.Compilation.BuildProvidersCompiler.ProcessBuildProviders()
at System.Web.Compilation.BuildProvidersCompiler.PerformBuild()
at System.Web.Compilation.BuildManager.CompileWebFile(VirtualPath
virtualPath)
at
System.Web.Compilation.BuildManager.GetVPathBuildResultInternal(VirtualPath
virtualPath, Boolean noBuild, Boolean allowCrossApp, Boolean
allowBuildInPrecompile)
at
System.Web.Compilation.BuildManager.GetVPathBuildResultWithNoAssert(HttpContext
context, VirtualPath virtualPath, Boolean noBuild, Boolean
allowCrossApp, Boolean allowBuildInPrecompile)
at System.Web.UI.TemplateControl.LoadControl(VirtualPath virtualPath)
at umbraco.developer.assemblyBrowser.Page_Load(Object sender,
EventArgs e) in
d:\TeamCity\buildAgent\work\7380c184e9fcd3ea\umbraco\presentation\umbraco\developer\Macros\assemblyBrowser.aspx.cs:line
3
Anyone who can offer help gets my undying appreciation....
Two things firstly is the control definately present in the directory /usercontrols/ secondly the codebehind for the form which I assume is compiled into a dll is that dll present in the bin directory?
To be frank, I'm very new to both .NET and Umbraco. I saw in Umbraco's interface there was no easy way of creating a form, so decided to chance it with the .NET source files. I copied the code for a similar form - a contact form - and customised accordingly.
The contact form had this at the start of the code, which I'm guessing is just a series of include calls to various files needed in the form:
As you can see I commented out the email field, as it wasn't needed. However I figured I was going to get into trouble with line 1: I don't know what the CodeBehind attribute does, and while I understand the concept of inheritance, I'm not really sure what I need to do with that Inherits attribute. I've saved this GradCamp file in the usercontrols directory - what else should I do? And can I happily get rid of that CodeBehind attribute?
When working with forms in Umbraco the best thing todo is purchase contour for E99 its very easy to use extremely flexible and you has loads of hooks. See http://umbraco.com/products/more-add-ons/contour.aspx for more details you can install full working version that will work on localhost if you want to evaluate first.
With regards to your query the way this is built is that the control / controls will refer to codebehind file that has logic this codebehind file is built into a dll and that dll lives in the bin. If that dll is missing then the usercontrol will try to reference the codebehind code but cannot. So you cannot just take it out. Also in the usercontrols directory do you have Common directory with all the other controls present?
If you are new to all this contour will make your life a lot easier ;-}
Hi Ismail, and thanks for the info. I guess the trouble is I just don't know how to set up the .dll file that the codebehind references. As I say, I pretty much copied the code from an existing form, then renamed accordingly. How was the .dll file for that form set up, I wonder?
I'm trying to download Contour but our install of Umbraco is pretty ancient, v4.0.4.2. So I need to use Contour v1.1.9. I've downloaded it but it's a free version - is this the right version, or do I need to purchase this older version somewhere? Not only that, once I've downloaded it I can't install it - I get a "Server error in '/' application" message.
I would look at where you got the source code from. There should be a visual studio project /solution file in there you can then open that in visual studio and build that to get a dll or if your lucky the dll should already be there. With regards to contour if you look at the pdf documenation there is a section in there about doing a manual install if the installer fails.
You will need to purchase license else it will only save to db when working localhost. Contact Umbraco for older license.
Error creating control when publishing a form
Hey guys. My third question in one day!
I've created an .ascx file called GradCamp, referenced it with a macro called Form - Grad Camp, linked that to a template called Grad Camp and attempted to pull that template into a user control page called Grad camp registration.
I'm getting an error on the page when I publish it:
Error creating control (/usercontrols/Forms/GradCamp.ascx).
Maybe file doesn't exists or the usercontrol has a cache directive, which is not allowed! See the tracestack for more information!
The tracestack spits this out:
System.Web.HttpParseException: Could not load type 'CampQuality.Web.usercontrols.Forms.GradCamp'. ---> System.Web.HttpParseException: Could not load type 'CampQuality.Web.usercontrols.Forms.GradCamp'. ---> System.Web.HttpException: Could not load type 'CampQuality.Web.usercontrols.Forms.GradCamp'. at System.Web.UI.TemplateParser.GetType(String typeName, Boolean ignoreCase, Boolean throwOnError) at System.Web.UI.TemplateParser.ProcessInheritsAttribute(String baseTypeName, String codeFileBaseTypeName, String src, Assembly assembly) at System.Web.UI.TemplateParser.PostProcessMainDirectiveAttributes(IDictionary parseData) --- End of inner exception stack trace --- at System.Web.UI.TemplateParser.ProcessException(Exception ex) at System.Web.UI.TemplateParser.ParseStringInternal(String text, Encoding fileEncoding) at System.Web.UI.TemplateParser.ParseString(String text, VirtualPath virtualPath, Encoding fileEncoding) --- End of inner exception stack trace --- at System.Web.UI.TemplateParser.ParseString(String text, VirtualPath virtualPath, Encoding fileEncoding) at System.Web.UI.TemplateParser.ParseFile(String physicalPath, VirtualPath virtualPath) at System.Web.UI.TemplateParser.ParseInternal() at System.Web.UI.TemplateParser.Parse() at System.Web.Compilation.BaseTemplateBuildProvider.get_CodeCompilerType() at System.Web.Compilation.BuildProvider.GetCompilerTypeFromBuildProvider(BuildProvider buildProvider) at System.Web.Compilation.BuildProvidersCompiler.ProcessBuildProviders() at System.Web.Compilation.BuildProvidersCompiler.PerformBuild() at System.Web.Compilation.BuildManager.CompileWebFile(VirtualPath virtualPath) at System.Web.Compilation.BuildManager.GetVPathBuildResultInternal(VirtualPath virtualPath, Boolean noBuild, Boolean allowCrossApp, Boolean allowBuildInPrecompile) at System.Web.Compilation.BuildManager.GetVPathBuildResultWithNoAssert(HttpContext context, VirtualPath virtualPath, Boolean noBuild, Boolean allowCrossApp, Boolean allowBuildInPrecompile) at System.Web.UI.TemplateControl.LoadControl(VirtualPath virtualPath) at umbraco.developer.assemblyBrowser.Page_Load(Object sender, EventArgs e) in d:\TeamCity\buildAgent\work\7380c184e9fcd3ea\umbraco\presentation\umbraco\developer\Macros\assemblyBrowser.aspx.cs:line 3
Anyone who can offer help gets my undying appreciation....
Tom,
Two things firstly is the control definately present in the directory /usercontrols/ secondly the codebehind for the form which I assume is compiled into a dll is that dll present in the bin directory?
Regards
Ismail
Hi Ismail
To be frank, I'm very new to both .NET and Umbraco. I saw in Umbraco's interface there was no easy way of creating a form, so decided to chance it with the .NET source files. I copied the code for a similar form - a contact form - and customised accordingly.
The contact form had this at the start of the code, which I'm guessing is just a series of include calls to various files needed in the form:
Then I set up my Grad Camp form's header info like this:
As you can see I commented out the email field, as it wasn't needed. However I figured I was going to get into trouble with line 1: I don't know what the CodeBehind attribute does, and while I understand the concept of inheritance, I'm not really sure what I need to do with that Inherits attribute. I've saved this GradCamp file in the usercontrols directory - what else should I do? And can I happily get rid of that CodeBehind attribute?
Cheers.
Tom,
When working with forms in Umbraco the best thing todo is purchase contour for E99 its very easy to use extremely flexible and you has loads of hooks. See http://umbraco.com/products/more-add-ons/contour.aspx for more details you can install full working version that will work on localhost if you want to evaluate first.
With regards to your query the way this is built is that the control / controls will refer to codebehind file that has logic this codebehind file is built into a dll and that dll lives in the bin. If that dll is missing then the usercontrol will try to reference the codebehind code but cannot. So you cannot just take it out. Also in the usercontrols directory do you have Common directory with all the other controls present?
If you are new to all this contour will make your life a lot easier ;-}
Regards
Ismail
Hi Ismail, and thanks for the info. I guess the trouble is I just don't know how to set up the .dll file that the codebehind references. As I say, I pretty much copied the code from an existing form, then renamed accordingly. How was the .dll file for that form set up, I wonder?
I'm trying to download Contour but our install of Umbraco is pretty ancient, v4.0.4.2. So I need to use Contour v1.1.9. I've downloaded it but it's a free version - is this the right version, or do I need to purchase this older version somewhere? Not only that, once I've downloaded it I can't install it - I get a "Server error in '/' application" message.
Tom,
I would look at where you got the source code from. There should be a visual studio project /solution file in there you can then open that in visual studio and build that to get a dll or if your lucky the dll should already be there. With regards to contour if you look at the pdf documenation there is a section in there about doing a manual install if the installer fails.
You will need to purchase license else it will only save to db when working localhost. Contact Umbraco for older license.
Regards
Ismail
is working on a reply...