Parser Error on created Master with Codebehind

Posted by Community Admin on 05-Aug-2018 16:14

Parser Error on created Master with Codebehind

All Replies

Posted by Community Admin on 12-Mar-2013 00:00

Version: 5.4.4010

I'm trying to upload a .master with a needed code-behind file.  I have uploaded the files to the folder specified on Sitefinity's master page instructions. When I go to view/edit the template based on the master I uploaded I get a  Parser Error Server Error in '/main' Application.

Parser Error
Description: An error occurred during the parsing of a resource required to service this request. Please review the following specific parse error details and modify your source file appropriately.

 It cannot load the namespace.class from the codebehind, as called in the first line of the .master.

 I've searched the forums and found a similar instance in version 4, saying to compile in Visual Studios.  After compiling, it finds the codebehind but errors out on unloading an updatepanel within the .master.  (BTW... This all works outside of Sitefinity.)

What might I be missing?  Thanks!

Posted by Community Admin on 14-Mar-2013 00:00

Dawn,

I ran up against this once...pretty sure this post helped me solve it. If that doesn't work out, I can try to dig up another solution. :)

Posted by Community Admin on 14-Mar-2013 00:00

@Dawn
Never came across this error. I usually just forget to build my Sitefinity App and upload the SitefinityApp.dll to the server along with my .master.

Looking forward to your findings.
Markus

Posted by Community Admin on 15-Mar-2013 00:00

Hi Dawn,

Can you let us know whether you have managed to resolve the problems on your end? Also if you still encounter errors with the update panel, can you let us know in more details, what actual errors you are receiving?

Regards,
Victor Velev
the Telerik team

Do you want to have your say in the Sitefinity development roadmap? Do you want to know when a feature you requested is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items

Posted by Community Admin on 18-Mar-2013 00:00

Thanks, Tim.  I'm still getting the error:

Server Error in '/' Application.
Cannot unregister UpdatePanel with ID 'SupNavBar' since it was not registered with the ScriptManager. This might occur if the UpdatePanel was removed from the control tree and later added again, which is not supported.
Parameter name: updatePanel
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the
code.
Exception Details: System.ArgumentException: Cannot unregister UpdatePanel with ID 'SupNavBar' since it was not registered with the ScriptManager. This might occur if the UpdatePanel was removed from the control tree and later added again, which is not supported.
Parameter name: updatePanel

The .master has a .cs behind it.  I'm trying to have a pull down menu which opens/closes on click of an imagebutton from within the updatepanel.  I have moved from an asp:UpdatePanel to using an sf:SitefinityUpdatePanel, I have added the code from the link Tim provided. I continue to get the error above.

Sorry for the delay in my response - I took an extended weekend vacation.

Posted by Community Admin on 21-Mar-2013 00:00

Hi Dawn,

The error reads:

Cannot unregister UpdatePanel with ID 'SupNavBar' since it was not registered with the ScriptManager. This might occur if the UpdatePanel was removed from the control tree and later added again, which is not supported. 

However such errors are not commonly encountered, therefore I would suggest to recreate the master file, using the guidelines from the provided link. Also please note that the ScriptManager must be the first control added to the runat="server" form if you are using a masterpage.

Also please note that Sitefinity has the ability to inject ScriptManager if your control requires it. You can decorate  your user control with the below attribute so that Sitefinity knows that this user control needs a ScriptManager:

[Telerik.Sitefinity.Modules.Pages.Web.UI.RequireScriptManager(true)]
public partial class WebUserControl : System.Web.UI.UserControl

This is generally a better approach to use the ScriptManager. If you do not have controls that need it on your pages it will not be included (improve page performance by not loading unnecessary scripts).

One another user however, who encountered the problem managed to resolve it. Here is a quick quote on his notes:

"It looks like the cause of this bug was that I was using a page template which contained a billing summary (expanded) that inherited another page template with a billing summary (expandable).  Changing the billing summary on the child template to the link version causes this error not to occur."

Greetings,
Victor Velev
the Telerik team
Do you want to have your say in the Sitefinity development roadmap? Do you want to know when a feature you requested is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items

Posted by Community Admin on 28-Mar-2013 00:00

Just for closure... I never did get this to work and just pulled the code out to a user control.  That works well enough.  Thanks.

This thread is closed