Can't Switch From Mobile Theme

Topics: Controls, Themes
Jul 24, 2011 at 8:30 PM

I'm using the standard theme and am getting an error when I try to switch out of the mobile theme in Safari on my Iphone.

Server Error in '/BlogEngine' Application.

 Control 'ctl00_ctl01' of type 'MobileThemeSwitch' must be placed inside a form tag with runat=server.

 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.Web.HttpException: Control 'ctl00_ctl01' of type 'MobileThemeSwitch' must be placed inside a form tag with runat=server.

 Source Error:

 The source code that generated this unhandled exception can only be shown when compiled in debug mode. To enable this, please follow one of the below steps, then request the URL:

 1. Add a "Debug=true" directive at the top of the file that generated the error. Example:

 <%@ Page Language="C#" Debug="true" %>

 or:

 2) Add the following section to the configuration file of your application:

 <configuration>

   <system.web>

       <compilation debug="true"/>

   </system.web>

</configuration>

 Note that this second technique will cause all files within a given application to be compiled in debug mode. The first technique will cause only that particular file to be compiled in debug mode.

 Important: Running applications in debug mode does incur a memory/performance overhead. You should make sure that an application has debugging disabled before deploying into production scenario.

 Stack Trace:

 [HttpException (0x80004005): Control 'ctl00_ctl01' of type 'MobileThemeSwitch' must be placed inside a form tag with runat=server.]

   System.Web.UI.Page.VerifyRenderingInServerForm(Control control) +8910280

   System.Web.UI.WebControls.LinkButton.AddAttributesToRender(HtmlTextWriter writer) +45

   System.Web.UI.WebControls.WebControl.RenderBeginTag(HtmlTextWriter writer) +20

   System.Web.UI.WebControls.WebControl.Render(HtmlTextWriter writer) +20

   System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter) +27

   System.Web.UI.Control.RenderControl(HtmlTextWriter writer, ControlAdapter adapter) +100

   System.Web.UI.Control.RenderControl(HtmlTextWriter writer) +25

   ASP.themes_standard_site_master.__Render__control1(HtmlTextWriter __w, Control parameterContainer) +623

   System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children) +109

   System.Web.UI.Control.RenderChildren(HtmlTextWriter writer) +8

   System.Web.UI.Control.Render(HtmlTextWriter writer) +10

   System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter) +27

   System.Web.UI.Control.RenderControl(HtmlTextWriter writer, ControlAdapter adapter) +100

   System.Web.UI.Control.RenderControl(HtmlTextWriter writer) +25

   System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children) +208

   System.Web.UI.Control.RenderChildren(HtmlTextWriter writer) +8

   BlogEngine.Core.Web.Controls.BlogBasePage.Render(HtmlTextWriter writer) in E:\Projects\BlogEngine_25_Release\BlogEngine\DotNetSlave.BusinessLogic\Web\Controls\BlogBasePage.cs:467

   System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter) +27

   System.Web.UI.Control.RenderControl(HtmlTextWriter writer, ControlAdapter adapter) +100

   System.Web.UI.Control.RenderControl(HtmlTextWriter writer) +25

   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +3060

 

Coordinator
Jul 26, 2011 at 12:18 PM

Have you made any modifications to the standard theme?

If so, if you could paste the contents of your site.master file here (for the Standard) theme, we can see if there's any problems.

The important thing is that <blog:MobileThemeSwitch runat="server" /> is inside <form runat="Server" class="body">.

Coordinator
Jul 26, 2011 at 12:19 PM

Also, what if you try switching your theme to the Indigo theme.  Do you get the same error when trying to switch out of the mobile theme while using the Indigo theme?

Jul 26, 2011 at 3:04 PM

Hi Ben,

Yes, I modified the standard theme site.master but I didn’t change the mobile theme site.master. I had already tried changing the mobile theme to a different one and it didn’t help. But after reading your post I looked at my standard theme site.master file and I did have the form tag moved. I didn’t think about checking the site.master file for the regular site since I hadn’t modified the mobile site.master. Problem Solved Thanks.

 

I am having another problem I could use your help with. I want to have the recent posts displayed in http://hrhelp.us/default.aspx in the root directory with <blog:RecentPosts runat="Server" />. It works fine on http://hrhelp.us/BlogEngine/Test.aspx. The test.aspx page works but the same code in the default.aspx page in the root directory doesn’t work. It gives this error:

 

Server Error in '/' 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.

Parser Error Message: Unknown server tag 'blog:RecentPosts'.

Source Error:

 

Line 111:<div id="recentposts">

Line 112:

Line 113:<blog:RecentPosts runat="Server" />

Line 114:

Line 115:


Source File: /default.aspx    Line: 113


Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.0.30319.1

 

 

 

Thanks,

Richard

Coordinator
Jul 27, 2011 at 12:11 AM

If you could paste the contents of your default.aspx file here, that might help to see the problem.

Jul 27, 2011 at 3:54 AM

Contents of default.aspx in the root directory which is where I want to display the recent posts, but blogengine.net is installed in the subdirectory /BlogEngine.

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">

<!-- #BeginTemplate "Templates/layout2.dwt" -->

<head>
<!-- #BeginEditable "title" -->
<title>Human Resource Advisory Services Personnel Advisor</title>
<!-- #EndEditable -->
<!-- #BeginEditable "description" -->
<meta name="description" content="Human Resource Advisory Services Personnel Advisor manuals save you time, with a convenient, easy-to-use format that lets you find the answers to your personnel questions quickly." />
<!-- #EndEditable -->
<!-- #BeginEditable "keywords" -->
<meta name="keywords" content="Human Resource Advisory Services Personnel Advisor manuals" />
<style type="text/css">
#I1 {
 float: top;
 height: 498px;
}
</style>
<!-- #EndEditable -->
<meta http-equiv="imagetoolbar" content="false" />
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<meta http-equiv="Content-Language" content="en-us" />
<link rel="stylesheet" type="text/css" href="style.css" />
<link rel="stylesheet" href="Scripts/lightbox.css" type="text/css" media="screen" />
<script type="text/javascript" src="Scripts/lightbox.js"></script>
</head>

<body>

<div class="wrapper row1">
<div id="global">
<!--#include virtual="Includes/globalhead.htm" -->
</div>
</div>

<div class="wrapper row2">
<div id="header">
<div id="logo">
<p class="sitename">The Personnel Advisor</p>
<p class="slogan">Human Resources Advisory Service</p>
</div>

</div>
</div>
<div class="wrapper1 row6">
<div id="mainnav">
<!--#include virtual="menu/body_menu.inc" -->
</div>
</div>
<div class="wrapper row4">
<div id="content">
<!-- #BeginEditable "content" -->
<div class="contentleft">
<h3 class="center">The Personnel Advisor</h3>
 <p><a href="http://www.thepersonneladvisor.net/purchase_options.asp">
 <img border="0" src="images/monitor_man_lg.jpg" width="32" alt="Human Resource Advisory Services" longdesc="Employers have referred to The Personnel Advisor to ensure compliance with state and federal employment laws and regulations." height="34" style="height: 255px; width: 300px" /></a></p>
  <p>
        &quot;<i>The
  Personnel Advisor</i>
        is an excellent resource. It is the best
  HR tool that I have encountered in the 28 years that I have been in the
  HR business.&quot; Victor Nardo, Human Resources Manager, Bridgeville, Pennsylvania
  backup</p>
 

</div> 

<div class="contentmiddle">
<h1>Human Resources Advisory Service</h1>
<p>
For over 25 years, employers
have referred to <i>The Personnel Advisor</i> to ensure compliance with state
and federal employment laws and regulations. <i>The Personnel Advisor</i> is a
comprehensive set of business tools specifically designed to help employers
avoid personnel problems, costly consultation fees, and expensive and
time-consuming lawsuits. Our cost effective service consists of an integrated
set of easy to use tools that include: a human resource reference manual,
regular updates, newsletters, a user-friendly and ad-free website with forms,
checklists, labor law posters, an employee handbook template, new hire packet,
answers to frequently asked questions, late-breaking employment news, and other
valuable HR tools.</p>
<p>
<i>The Personnel Advisor</i>
covers everything an employer needs for effective personnel management and
provides quick answers to commonly asked questions in any workplace. Using our
business tools, employers can find solutions to human resource situations that
require prompt attention including the Family and Medical Leave Act (FMLA), the
Americans with Disabilities Act (ADA), COBRA, HIPAA, exempt versus non-exempt
employees, overtime pay, sexual harassment, wage and hour laws, hiring and
terminating employees. Select the <a href="http://thepersonneladvisor.net/preview/preview.asp">
Preview</a> button to view a sample of our <u>
web</u> <u>service</u> features. Or, order a
<a href="30-day" _mce_href="http://thepersonneladvisor.net/preview/thirty_day_review.htm">30-day">http://thepersonneladvisor.net/preview/thirty_day_review.htm">30-day
review</a>
of our desk top <u>reference</u> <u>manual</u>.</p>
</div>
 <div class="contentright">

       
<div class="wrapper row4">
<div id="content">
<div class="contentleft">
 <h3>HR Help Hot News</h3>
 
     </div>
</div></div>
<div class="clearcontent"></div>
<div id="recentfront">
<div id="recentposts">

<blog:RecentPosts runat="Server" />


</div>

</div>
</div>
<!-- #EndEditable -->
<div class="clearcontent"></div>
</div>
</div>
<div class="wrapper row5">
<div id="footer">
<!--#include virtual="Includes/globalfoot.htm" --><p>The Personnel Advisor &copy; 2011 | All Rights Reserved | Developed by Cybertronics</p>
</div>
</div>
</body>
<!-- #EndTemplate -->
</html>

Coordinator
Jul 27, 2011 at 4:02 AM

The problem is that if BE is installed in a sub-directory -- I presume that means it's installed as a sub-application .... and in the BE folder, it has its own BIN directory, App_Code directory, etc.  In this case, the BE controls such as RecentPosts are not available to be used outside the BE application.

To get the recent BE posts from outside BE, there are a few options.  The main thing you'll probably want to do is read/consume the BE RSS feed from your application.  Meaning, you would read the BE RSS feed and output that feed into your page.  There are several ways to do this.  You could create your own component, or find an existing one.  Probably a relatively easy method to do it would be to use a 3rd party RSS widget/component ... I think Feedburner might have one, and maybe some others.  I think these places have widgets you can plug into your site (they are JavaScript based widgets), and they read an RSS feed and output the items on the page.  I'm not sure what all is out there for this, but suspect there's something already created you can use.