Page 1 of 1

Only Content controls are allowed directly in a content page

Posted: Tue Jun 22, 2010 11:10 pm
by draneb
Hello,

I am receiving the following errors in AC admin error logs as often as every minute.
Would anyone be able to shed some light as to what it means? This is an example of the URL. Of course the ProductId changes.

An error has occured at http://www.mydomain.com/Errors/GeneralE ... ctId=23564
Only Content controls are allowed directly in a content page that contains Content controls.; Only Content controls are allowed directly in a content page that contains Content controls.


I also receive them with the Category in the URL
An error has occured at http://www.mydomain.com/Errors/GeneralE ... goryId=309
Only Content controls are allowed directly in a content page that contains Content controls.; Only Content controls are allowed directly in a content page that contains Content controls.

Thank you very much!

Re: Only Content controls are allowed directly in a content page

Posted: Wed Jun 23, 2010 5:18 am
by mazhar
One idea could be to make sure that all your page contents are withing asp:content section if this a child page inherited from master.

Re: Only Content controls are allowed directly in a content page

Posted: Wed Jun 23, 2010 8:44 am
by draneb
Hi Mazhar,

Uh oh.. I was afraid it would be something I wouldn't understand.

You know the weird thing is I just finished moving hosting companies and I never had this error before. Once I completed the move they started coming in.
Better hosting company but new problem. ha!

Does that error mean it is a ConLib control or not necessarily? Since it is happening on the Category and Product pages I am assuming it is a ConLib that is appearing on both of those pages? I have one or two Custom ConLib's I have always used.

Everything is displaying fine for me. If I type in the URL without the "Errors/GeneralError" part the page looks fine so that is confusing even more.

I thought at first it was how I was typing the ConLib out. Some looked like this
[[ConLib:Custom/ContactUs]] and some looked like this
[[ConLib:Custom\ContactUs]]

Oddly enough both will display properly. I looked in the forums and people are typing them out both ways. I changed them all to to have a \ forward slash. Is that the proper way? I thought that was going to fix it, but it didn't.

Thank you!

Re: Only Content controls are allowed directly in a content page

Posted: Tue Jun 29, 2010 5:16 pm
by draneb
I still have not been able to figure out why they are happening. Here lately, instead of a typical product URL I am seeing these URLs.

/Errors/GeneralError.aspx?aspxerrorpath=/ScriptResource.axd
/Errors/GeneralError.aspx?aspxerrorpath=/WebResource.axd

Only Content controls are allowed directly in a content page that contains Content controls.; Only Content controls are allowed directly in a content page that contains Content controls.

Running AC 7.0.3 with SP1 and latest Global.asax file
.axd files Disallowed in robots.txt file

Does this have anything to do with a machinekey? I don't have one of those in place yet. I am going to do that right now.
Thanks!

Re: Only Content controls are allowed directly in a content page

Posted: Tue Jun 29, 2010 9:27 pm
by AbleMods
Could be several things:

1. Permissions could be incorrect on certain folders or files within the site.

2. The ASP.Net version is set wrong in the IIS configuration for your site.

3. Not all the files were transferred over to the new site i.e. some files are missing.

4. All of the above

Unfortunately it's going to take someone fairly techie with web hosting to figure it out. Has your new ISP not been helpful with resolving the issues?

Re: Only Content controls are allowed directly in a content page

Posted: Wed Jun 30, 2010 6:51 am
by jmestep
I haven't had time to look at it for him also. draneb, one thing you might try is having the hoster set the AppPool to classic mode instead of integrated pipeline. We just had to do that for a site we moved to a dedicated server that still has their old Able CF site running also until the Able 7 goes live. We were getting an error that something .axd wasn't registered (don't remember exactly what). We had copied the Able 7 files from the dev server and all the files were the same, so we knew it wasn't that.
I thought I had seen a forum post about it, but I couldn't find it.

Re: Only Content controls are allowed directly in a content page

Posted: Wed Jun 30, 2010 10:10 am
by draneb
Hi Joe, no unfortunately I signed up for a self-managed VPS. They will only look at issues they are responsible for.
This was also the first time I have had to go through such an experience as setting up a server from scratch so it is very possible I have some settings wrong somewhere. What does this mean?

2. The ASP.Net version is set wrong in the IIS configuration for your site.
What should it be set to?
I see several APP Pools
ASP.NET 2.0 (Classic), ASP.NET 2.0 (Integrated), ASP.NET 4.0 (Classic), ASP.NET 4.0 (Integrated) and then this one
DefaultAppPool 2.0 (Integrated)

Under "Sites"
there is "Default Web Site" running under "DefaultAppPool" and then there is another site created with my companyname running under ASP.NET 2.0 (Integrated). Both are running... My host must have initially setup my site under Default Web Site and then I came in and created one under my companyname. Should there only be one? And if so, could that be causing the problems?

Hi Judy :) Yeah one of these days when you have time it would give me great piece of mind if you checked things out.

Ohh one last thing...
1) I added a machine key last night. The errors seemed to stop. I haven't received one since then. Would that have anything to do with these errors?
2) This morning I did the TestPermissions.aspx text and everything passed but I did notice for permissions "Network Service" had everything checked but Full. It had read, write, modify, etc. all individually checked but Full was not. I checked Full just to see if it made a difference.

I still have not received one error since last night. :) I don't want to get my hopes up because they have stoped for hours at a time before. I think they just take a break before pouring in again. haha

Thanks for all your help guys and gals.

Re: Only Content controls are allowed directly in a content page

Posted: Wed Jun 30, 2010 1:22 pm
by AbleMods
draneb wrote:1) I added a machine key last night. The errors seemed to stop. I haven't received one since then. Would that have anything to do with these errors?
That would have caused the problem - any encrypted files like the database.config etc would not have been readable on the new host until the machine key was reset. The machine key is specific to the physical computer running the site. Yours was most definitely still set to the old hosting platform.

Although I'm not sure how that'll work in a VPS environment. If they light up your virtual instance on a different box for whatever reason, does that invalidate the existing machine key? Logan and others might be able to answer that better than me as I've had no extensive experience with VPS and IIS.

Re: Only Content controls are allowed directly in a content page

Posted: Thu Jul 01, 2010 7:33 am
by jmestep
Setting a machineKey in the web.config has helped us to move sites. I'm not the one that moves them, but I had also suggested that they make sure to create the key in the admin and then use the backups of that (keypart1.bin or something like that) and then restore them after the move. Doing those things has eliminated all problems with the move.

Re: Only Content controls are allowed directly in a content page

Posted: Thu Jul 01, 2010 7:44 am
by draneb
Judy, they're baaaaack... I give up! :)

Re: Only Content controls are allowed directly in a content page

Posted: Thu Jul 01, 2010 2:15 pm
by mikek
Hi draneb,

One more thing that you may need to double check:

- open Windows Explorer and navigate to the site root folder
- right click on the site folder, select Properties
- from the Properties Window click on Security Tab
- make sure that IIS_IUSRS account is included and has Modify/Read/Write permissions to the site root folder

If the ASP.NET application pool is running under another account (not the default NetworkService) account permissions must be granted to that account as well.

Hope this will help ...

Re: Only Content controls are allowed directly in a content page

Posted: Thu Jul 01, 2010 5:18 pm
by jmestep
MikeK- Are you sure you should give IUSRS modify and write permissions?
The person who had the security breach in this topic
viewtopic.php?f=39&t=13873

has said in another contact with him (I couldn't find where the Able help said something about IIS_IUSRS, but I don't have a lot of luck with some searches)
I'm reviewing the documentation on your minimum permissions required. The problem I see with this configuration is that it opens up a security hole which is exactly how I got hit, I believe. I used to have IIS_IUSRS set to allow MODIFY permissions (mod/read/read&exex/list/write) on all folders. When this trojan dropped in the image.aspx, image.asp, and newup.asp files, somehow it had sufficient permissions to create files on the server.

Re: Only Content controls are allowed directly in a content page

Posted: Thu Jul 01, 2010 10:25 pm
by AbleMods
IIS_IUSRS is used on IIS7 installs (Win7 or Win2k8)

On Win2K3, WinXP it's ASPNET and NetworkService