Mariette
 Basic Member
 Posts:100

 | | 31 May 2007 12:41 PM |
| I want not to load the search skin object when the URL has a register or login control loaded. How do I do that? |
| | |
|
John Mitchell Administrator
 Veteran Member
 Posts:3667

 | | 01 Jun 2007 07:53 AM |
| You could do that by putting the following code in your skin:
<scriptrunat="server">
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
If Request.Url.PathAndQuery.ToLower().IndexOf("ctl=register") > -1 Or _
Request.Url.PathAndQuery.ToLower().IndexOf("ctl=login") > -1 Then
dnnSEARCH.visible = false
End If
End Sub
</script> |
| | |
|
John Mitchell Administrator
 Veteran Member
 Posts:3667

 | | 05 Jun 2007 06:06 PM |
| Did this work out for you Mariette? |
| | |
|
Mariette
 Basic Member
 Posts:100

 | | 06 Jun 2007 02:48 PM |
| Sorry John, still have to test it but when I do I will let you know :-) |
| | |
|
Mariette
 Basic Member
 Posts:100

 | | 09 Jun 2007 01:21 AM |
| That did not work. For some reason the skin did not load anymore and I got the default dnn skin. |
| | |
|
John Mitchell Administrator
 Veteran Member
 Posts:3667

 | | 09 Jun 2007 01:40 AM |
| Check to make sure that the ID of your search SkinObject is actually called dnnSEARCH It may just be "search". < dnn:Search runat="server" cssclass="search" id="search" showSite="False" showWeb="False" />
<scriptrunat="server">
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
If Request.Url.PathAndQuery.ToLower().IndexOf("ctl=register") > -1 Or _
Request.Url.PathAndQuery.ToLower().IndexOf("ctl=login") > -1 Then
search.visible = false
End If
End Sub
</script> |
| | |
|
Mariette
 Basic Member
 Posts:100

 | | 09 Jun 2007 02:10 AM |
| Message: DotNetNuke.Services.Exceptions.PageLoadException: Unhandled error loading page. ---> System.Web.HttpCompileException: D:\www.smallbizserver.net\Portals\0\Skins\SBS2006\default.ascx(16): error BC30456: 'visible' is not a member of 'Search'. 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 DotNetNuke.Framework.DefaultPage.LoadSkin(String SkinPath) --- End of inner exception stack trace ---
|
| | |
|
John Mitchell Administrator
 Veteran Member
 Posts:3667

 | | 09 Jun 2007 02:21 AM |
| So you do have a search skin object in your skin right? < dnn:Search runat="server" cssclass="search" id="search" showSite="False" showWeb="False" />
I tested this code and it works in my skin on 4.5.3 If you want, you can attach the skin to your next post and I'll take a look. |
| | |
|
Mariette
 Basic Member
 Posts:100

 | |
John Mitchell Administrator
 Veteran Member
 Posts:3667

 | |
Mariette
 Basic Member
 Posts:100

 | | 10 Jun 2007 01:06 PM |
| John, Well, that works but I had the same code at the same place...never mind...it works now Thanks a million |
| | |
|
stefandebie
 New Member
 Posts:4
 | | 05 Oct 2007 06:56 AM |
| Hi,
I also need this feature but to hide an other module.
I pasted the code in my skin.ascx file and replaced dnnSEARCH with dnnDOCUMENTSSUMMARY (a module that was made by myself).
But it won't work...The module keeps showing up when I am logged in, can anyone tell me what I am doing wrong please?
this is my code:
<%@ Register TagPrefix="dnn" TagName="DOCUMENTSSUMMARY" Src="~/DesktopModules/DocumentsSummary/ViewDocumentsSummary.ascx" %> <script runat="server"> Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load If Request.Url.PathAndQuery.ToLower().IndexOf("ctl=login") > -1 Then dnnDOCUMENTSSUMMARY.Visible = False End If End Sub </script>
Thanks in advance |
| | |
|
stefandebie
 New Member
 Posts:4
 | | 08 Oct 2007 01:55 AM |
| Can anyone help me please?
I am using DNN 4.6.2...
thanks in advance |
| | |
|
John Mitchell Administrator
 Veteran Member
 Posts:3667

 | | 08 Oct 2007 11:19 AM |
| Maybe the Url does not have ctl=login where you expect it.
To Test, try adding a Response.write statment just above the code that checks the Url. <scriptrunat="server">
Private Sub Page_Load(ByVal sender As System.Object, ByVal e As System.EventArgs) Handles MyBase.Load
Response.write Request.Url.PathAndQuery
If Request.Url.PathAndQuery.ToLower().IndexOf("ctl=login") > -1 Then
dnnDOCUMENTSSUMMARY.Visible = False
End If
End Sub
</script> |
| | |
|