LoginLink Error controlID empty string

This forum is only for questions or discussions about working with the mojoPortal source code in Visual Studio, obtaining the source code from the repository, developing custom features, etc. If your question is not along these lines this is not the right forum. Please try to post your question in the appropriate forum.

Please do not post questions about design, CSS, or skinning here. Use the Help With Skins Forum for those questions.

This forum is for discussing mojoPortal development

This forum is only for questions or discussions about working with the mojoPortal source code in Visual Studio, obtaining the source code from the repository, developing custom features, etc. If your question is not along these lines this is not the right forum. Please try to post your question in the appropriate forum.

You can monitor commits to the repository from this page. We also recommend developers to subscribe to email notifications in the developer forum as occasionally important things are announced.

Before posting questions here you might want to review the developer documentation.

Do not post questions about design, CSS, or skinning here. Use the Help With Skins Forum for those questions.
This thread is closed to new posts. You must sign in to post in the forums.
5/17/2012 8:53:51 AM
Gravatar
Total Posts 9

LoginLink Error controlID empty string

I am having issues with the LoginLink control. When I run my local dev site from Visual Studios everything works as expected except for when I try to sign in. I get the error "Input parameter 'controlId' cannot be an empty string."

Thanks in advance...

Here are the error details:

 

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: Input parameter 'controlId' cannot be an empty string.

Source Error:



Line 1535:                }
Line 1536:
Line 1537:                base.Render(writer);
Line 1538:                return;
Line 1539:            }



Source File: I:\mojoBase\Web\Components\mojoBasePage.cs    Line: 1537

Stack Trace:

[ArgumentException: Input parameter 'controlId' cannot be an empty string.]
   System.Web.Util.StringUtil.CheckAndTrimString(String paramValue, String paramName, Boolean throwIfNull, Int32 lengthToCheck) +3005261
   System.Web.UI.ClientScriptManager.RegisterExpandoAttribute(String controlId, String attributeName, String attributeValue, Boolean encode) +52
   System.Web.UI.ScriptRegistrationManager.RegisterExpandoAttribute(Control control, String controlId, String attributeName, String attributeValue, Boolean encode) +115
   System.Web.UI.ScriptManager.RegisterExpandoAttribute(Control control, String controlId, String attributeName, String attributeValue, Boolean encode) +44

[TargetInvocationException: Exception has been thrown by the target of an invocation.]
   System.RuntimeMethodHandle._InvokeMethodFast(IRuntimeMethodInfo method, Object target, Object[] arguments, SignatureStruct& sig, MethodAttributes methodAttributes, RuntimeType typeOwner) +0
   System.RuntimeMethodHandle.InvokeMethodFast(IRuntimeMethodInfo method, Object target, Object[] arguments, Signature sig, MethodAttributes methodAttributes, RuntimeType typeOwner) +72
   System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture, Boolean skipVisibilityChecks) +251
   System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture) +28
   System.RuntimeType.InvokeMember(String name, BindingFlags bindingFlags, Binder binder, Object target, Object[] providedArgs, ParameterModifier[] modifiers, CultureInfo culture, String[] namedParams) +2377
   System.Web.UI.WebControls.ValidatorCompatibilityHelper.RegisterExpandoAttribute(Control control, String controlId, String attributeName, String attributeValue, Boolean encode) +170
   System.Web.UI.WebControls.BaseValidator.AddAttributesToRender(HtmlTextWriter writer) +330
   System.Web.UI.WebControls.RegularExpressionValidator.AddAttributesToRender(HtmlTextWriter writer) +18
   System.Web.UI.WebControls.WebControl.RenderBeginTag(HtmlTextWriter writer) +20
   System.Web.UI.WebControls.BaseValidator.Render(HtmlTextWriter writer) +445
   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
   System.Web.UI.WebControls.WebControl.RenderContents(HtmlTextWriter writer) +10
   System.Web.UI.WebControls.Login.Render(HtmlTextWriter writer) +118
   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
   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
   System.Web.UI.WebControls.WebControl.RenderContents(HtmlTextWriter writer) +10
   System.Web.UI.WebControls.WebControl.Render(HtmlTextWriter writer) +32
   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
   System.Web.UI.WebControls.WebControl.RenderContents(HtmlTextWriter writer) +10
   System.Web.UI.WebControls.WebControl.Render(HtmlTextWriter writer) +32
   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
   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
   System.Web.UI.WebControls.WebControl.RenderContents(HtmlTextWriter writer) +10
   System.Web.UI.WebControls.WebControl.Render(HtmlTextWriter writer) +32
   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.HtmlControls.HtmlForm.RenderChildren(HtmlTextWriter writer) +173
   System.Web.UI.HtmlControls.HtmlContainerControl.Render(HtmlTextWriter writer) +31
   System.Web.UI.HtmlControls.HtmlForm.Render(HtmlTextWriter output) +53
   System.Web.UI.Control.RenderControlInternal(HtmlTextWriter writer, ControlAdapter adapter) +27
   System.Web.UI.Control.RenderControl(HtmlTextWriter writer, ControlAdapter adapter) +100
   System.Web.UI.HtmlControls.HtmlForm.RenderControl(HtmlTextWriter writer) +40
   System.Web.UI.Control.RenderChildrenInternal(HtmlTextWriter writer, ICollection children) +208
   System.Web.UI.Control.RenderChildren(HtmlTextWriter writer) +8
   System.Web.UI.HtmlControls.HtmlContainerControl.Render(HtmlTextWriter writer) +31
   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
   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
   System.Web.UI.Page.Render(HtmlTextWriter writer) +29
   mojoPortal.Web.mojoBasePage.Render(HtmlTextWriter writer) in I:\mojoBase\Web\Components\mojoBasePage.cs:1537
   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

 

5/17/2012 9:09:58 AM
Gravatar
Total Posts 18439

Re: LoginLink Error controlID empty string

That is not an error from the LoginLink control, that is an error after clicking the link which means its happening on the login page. The error also seems to originate in ScriptManager.

Since I cannot reproduce this error I can only guess that you have modified mojoPortal code or are using a custom login page or something is wrong in your skin possibly related to scriptmanager.

System.Web.UI.ScriptManager.RegisterExpandoAttribute sounds like you are adding a custom attribute somewhere.

​If you have not modifed mojoPortal code I would try a different skin and see if that is a factor. If you provide steps that reliably produce this error I would investigate it.

5/17/2012 8:09:44 PM
Gravatar
Total Posts 9

Re: LoginLink Error controlID empty string

Thanks for your help.  The only code I have changed is in the skin's layout.master. This is what it looks like:

 

<%@ Master Language="C#" AutoEventWireup="true" CodeBehind="~/App_MasterPages/layout.Master.cs" Inherits="mojoPortal.Web.layout" %>
<!doctype html>
<!--[if lt IE 7]><html class="no-js ie6 oldie" lang="en"><![endif]-->
<!--[if IE 7]><html class="no-js ie7 oldie" lang="en"><![endif]-->
<!--[if IE 8]><html class="no-js ie8 oldie" lang="en"><![endif]-->
<!--[if IE 9]><html class="no-js ie9" lang="en"><![endif]-->
<!--[if (gt IE 9)|!(IE)]><!-->
<html class="no-js" lang="en">
<!--<![endif]-->
<head id="Head1" runat="server">
<script type="text/javascript" src="/Data/srbcjs/modernizr.custom.41504.js"></script>
<!--[if (gte IE 6)&(lte IE 8)]>
<script type="text/javascript" src="/Data/srbcjs/selectivizer-min.js"></script>
<![endif]-->

<!--[if lt IE 7 ]>
    <script src="//ajax.googleapis.com/ajax/libs/chrome-frame/1.0.2/CFInstall.min.js"></script>
    <script>window.attachEvent("onload",function(){CFInstall.check({mode:"overlay"})})</script>
<![endif]-->
    <title></title>
   
    <portal:StyleSheetCombiner ID="StyleSheetCombiner" runat="server"
        JQueryUIThemeName="cupertino" UseIconsForAdminLinks="false" UseTextLinksForFeatureSettings="true" />
   
    <portal:MetaContent ID="MetaContent" runat="server" />
     <meta charset="utf-8" />
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
     <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <portal:Favicon ID="Favicon1" runat="server" />
    <portal:ScriptLoader ID="ScriptLoader1" runat="server" />
    <portal:SkinFolderScript ID="sfs1" runat="server" ScriptFileName="script.js" AddToCombinedScript="true" />
</head>
<body class="pagebody" id="Body" runat="server">
    <portal:AnalyticsAsyncTopScript ID="analyticsTop" runat="server" />
    <form id="frmMain" runat="server">
    <asp:SiteMapDataSource ID="SiteMapData" runat="server" ShowStartingNode="false" />
    <asp:SiteMapDataSource ID="PageMapDataSource" runat="server" ShowStartingNode="false" />
    <asp:SiteMapDataSource ID="ChildPageSiteMapData" runat="server" ShowStartingNode="false" />
    <asp:ScriptManager ID="ScriptManager1" EnablePageMethods="true" runat="server" EnableScriptGlobalization="true" EnableScriptLocalization="true" />
   
    <div id="pageWrapper">   
  
   
    <!-- Header BG -->    
    <div id="header_bg">

    <!-- Main Page Container -->
    <div class="container" id="pageTop">


<!-- Page Header -->
<header class="pageHeader">
<div class="row navShow">
<div class="twelvecol last navigationDisplay" id="navigationDisplay">


<!-- Logo -->
 <asp:HyperLink ID="HyperLinkLogo" runat="server" SkinID="MainHyperLinkLogo" EnableViewState="false" />

 <!-- Service Drop Down Panel Link -->
<a id="servicePanelLink" href="#">SERVICE TIMES &nbsp; | &nbsp; LOCATION &nbsp; <span id="panelArrow"></span></a>

<!-- Ministry Drop Down Panel Link -->
<div id="minTab"><a href="#" class="minTabTrigger" title="Ministry Index"></a>
</div>

<div class="row">
<div class="eightcol"></div>
<div class="fourcol last" id="loginViewCol">

<portal:LoginLink id="LoginLink" runat="server" RenderAsListItem="true" />
        <portal:LogoutLink id="LogoutLink" runat="server" RenderAsListItem="true" />

</div>

</div>

<nav id="globalNav">
<div class="globalNavWrapper">
 <div class="globalMenuWrapper">
 <portal:SiteMenu ID="SiteMenu1" runat="server" UseTreeView="true" TreeViewPopulateOnDemand="false" HideMenuOnSiteMap="false" SuppressImages="true"></portal:SiteMenu> 

 </div>
</div>

</nav>

</div>
</div>
</header>                           
                       
<div id="main">       
                                                     <asp:Panel ID="divLeft" runat="server" CssClass="art-layout-cell art-sidebar1 leftside"
                                    Visible="True" SkinID="pnlPlain">
                                    <portal:PageMenu ID="PageMenu1" runat="server" UseTreeView="true" IsSubMenu="true"
                                        TreeViewShowExpandCollapse="false" />
                                    <asp:ContentPlaceHolder ID="leftContent" runat="server">
                                    </asp:ContentPlaceHolder>
                                </asp:Panel>
<asp:Panel ID="divCenter" runat="server" Visible="True" CssClass="center-rightandleftmargins"
                                    SkinID="pnlPlain">
                                    <portal:Breadcrumbs ID="Breadcrumbs" runat="server"></portal:Breadcrumbs>
                                    <portal:ChildPageMenu ID="ChildPageMenu" runat="server" CssClass="txtnormal"></portal:ChildPageMenu>
                                    <a id="startcontent"></a>
                                    <asp:ContentPlaceHolder ID="mainContent" runat="server">
                                    </asp:ContentPlaceHolder>
                                </asp:Panel>                       <asp:Panel ID="divRight" runat="server" Visible="True" CssClass="art-layout-cell art-sidebar2 rightside"
                                    SkinID="pnlPlain">
                                    <asp:ContentPlaceHolder ID="rightContent" runat="server">
                                    </asp:ContentPlaceHolder>
                                </asp:Panel>

<portal:AutoHidePanel ID="ah1" runat="server">
            <div id="toolbarbut">
                <span class="showbar"><a href="#">show bar</a></span>
            </div>
            <div id="toolbar">
                <div class="toolbarleft">
                    &nbsp;
                </div>
                <div class="toolbarright">
                    <span class="downarr"><a href="#"></a></span>
                    <portal:AdminMenuLink ID="lnkAdminMenu" runat="server" />
                    <portal:FileManagerLink ID="lnkFileManager" runat="server" />
                    <portal:NewPageLink ID="lnkNewPage" runat="server" />
                    <portal:PageEditFeaturesLink ID="lnkPageContent" runat="server" />
                    <portal:PageEditSettingsLink ID="lnkPageSettings" runat="server" />
                    <asp:ContentPlaceHolder ID="pageEditContent" runat="server">
                    </asp:ContentPlaceHolder>
                </div>
            </div>
        </portal:AutoHidePanel>
</div>
</div>
</div>                          
</div>


<!-- Page Footer -->
<footer class="pageFooter">
<div class="footerDivider"></div>
<div class="footerContent">
<div class="container">
<asp:ImageMap ID="ImageMapFlag" runat="server" SkinID="SocialMediaImageMapFlag" AlternateText="Follow Us on Facebook and Twitter" EnableViewState="false">
</asp:ImageMap>

<!-- Footer Links -->
<div class="row links">
                    <nav>
                        <!-- Links Col 1 -->
                        <div class="twocol">
                            <h1 class="footerHeading footerLinkHeading">
                                Quick Links</h1>
                            <ul class="footerLinks">
                                <li><a href="#">I'm New to SRBC</a></li>
                                <li><a href="#">Directions</a></li>
                                <li><a href="#">Calendar</a></li>
                                <li><a href="#">Contact Us</a></li>
                            </ul>
                           
                        </div>
                        <!-- Links Col 2 -->
                        <div class="twocol">
                            <h1 class="footerHeading footerLinkHeading">
                                About Us</h1>
                            <ul class="footerLinks">
                                <li><a href="#">Our History</a></li>
                                <li><a href="#">What We Believe</a></li>
                                <li><a href="#">Meet Our Staff</a></li>
                                <li><a href="#">Office Hours</a></li>
                            </ul>
                        </div>
                        <!-- Links Col  3 -->
                        <div class="twocol">
                            <h1 class="footerHeading footerLinkHeading">
                                Media</h1>
                            <ul class="footerLinks">
                                <li><a href="#">Sermons</a></li>
                                <li><a href="#">Newsletter</a></li>
                                <li><a rel="leanModal" href="#newsletterSignUp">Email Sign Up</a></li>
                                <li><a href="#">Media Center</a></li>
                            </ul>
                        </div>
                    </nav>
                    <div class="threecol last srbcInfo">
                       
                    </div>

                    <div class="row">
                    <div class="twelvecol last">
                     <!-- search -->
                   
</div>
                   
                    </div>
                </div>

</div>
</div>

<p class="copyRight">
        
                <asp:Label ID="copyRightDateLabel" runat="server" EnableViewState="false"></asp:Label>
          
            <asp:HyperLink ID="HyperLink1" runat="server" SkinID="CopyRightLink" EnableViewState="false" />
            |
      <a href="#privacyPolicy" id="privacyPolicyModal" title="Privacy Policy" rel="leanModal">Privacy Policy</a>    
       
                                    <portal:SiteMapLink ID="SiteMapLink1" runat="server" CssClass="sitemaplink" />
                                    |
                                    <portal:CopyrightLabel ID="cl1" runat="server" ShowYear="true" BeginYear="2008" />
                                   </p>
       

</footer>
    </form>
    <portal:AnalyticsAsyncBottomScript ID="analyticsBottom" runat="server" />
</body>
</html>
 

5/18/2012 7:44:57 AM
Gravatar
Total Posts 18439

Re: LoginLink Error controlID empty string

Does the problem happen when using other skins?

Are you working with source code from our repository or using the pre-compiled release files in VS?

 

5/18/2012 9:31:39 AM
Gravatar
Total Posts 9

Re: LoginLink Error controlID empty string

No, it doesn't happen with other skins. And I am working from the repository via tortoisehg.  I copied one of the provided skin files as a template and then adjusted it to my own design.

5/18/2012 10:21:37 AM
Gravatar
Total Posts 18439

Re: LoginLink Error controlID empty string

Looking at your layout.master nothing major really jumps out at me, but I think the way to troubleshoot it is to chop things out until the error goes away to find what is causing the problem.

One small point I would fix your meta elements to have closing tags as if it were xml/xhtml, ie use /> not > 

First thing I would chop out is the <asp:ImageMap to see if that is a factor, I know that <asp:Image can cause problems if no ImageUrl is specified.

Also your loginlink and logoutlink should have RenderAsLisItem="false" since they are not inside a ul

I can say that I've also been working on some html 5 skins (similar to what you are doing) for inclusion in the next release, based on twitter bootstrap and foundation and I have not had any errors like that. The ones I'm creating will be mainly intended as a starting point for designers, they won't be pretty out of the box.

Hope that helps,

Joe

5/19/2012 9:52:37 PM
Gravatar
Total Posts 9

Re: LoginLink Error controlID empty string

I have tried multiple ways to fix this problem.  Even stripped everything out of the master except the required controls. Is there any possible what I could upload my files/source code somewhere and someone could take a look at it? I have no idea what is causing this.

5/19/2012 9:56:12 PM
Gravatar
Total Posts 9

Re: LoginLink Error controlID empty string

I am working in .Net 4. Is it possible that this is what is causing the problem?  However, I do have the web.config setup properly for .Net 4.

5/19/2012 9:58:59 PM
Gravatar
Total Posts 9

Re: LoginLink Error controlID empty string

one more thing....

I also changed the client id mode to static rather than auto. Is this a problem?

5/19/2012 10:07:16 PM
Gravatar
Total Posts 9

Re: LoginLink Error controlID empty string

I figured it out, its the client id mode.  When I changed it back to auto, I was able to access the login page.  Is there anyway to fix this?  All of my css is written based on static mode.

5/21/2012 7:49:23 AM
Gravatar
Total Posts 18439

Re: LoginLink Error controlID empty string

I recommend you don't change that in Web.config. Changing that setting in Web.config has widespread implications, it affects all features and will likely result in unexpected behavior and errors. I recommend use CSS classes and class selectors instead  of id selectors.

Hope that helps,

Joe

You must sign in to post in the forums. This thread is closed to new posts.