Sign In  |  Register
 
 DotNetNuke Powered!
DotNetNuke Support Forums

Don't load skinobject when certain control loads

Rate this topic:

Please Register to post a reply.
Another benefit of registration is the ability to subscribe to and recieve notifications of new posts.

AuthorMessages
Mariette
Posts:102



05/31/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?


DotNetNuke Platinum Benefactor
Mariette Knap - www.smallbizserver.net
John Mitchell
Posts:3369



06/01/2007 7: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
Posts:3369



06/05/2007 6:06 PM  
Did this work out for you Mariette?
Mariette
Posts:102



06/06/2007 2:48 PM  
Sorry John, still have to test it but when I do I will let you know :-)


DotNetNuke Platinum Benefactor
Mariette Knap - www.smallbizserver.net
Mariette
Posts:102



06/09/2007 1:21 AM  
That did not work. For some reason the skin did not load anymore and I got the default dnn skin.


DotNetNuke Platinum Benefactor
Mariette Knap - www.smallbizserver.net
John Mitchell
Posts:3369



06/09/2007 1: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
Posts:102



06/09/2007 2: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 ---


DotNetNuke Platinum Benefactor
Mariette Knap - www.smallbizserver.net
John Mitchell
Posts:3369



06/09/2007 2: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
Posts:102



06/10/2007 5:19 AM  
Pls, find attached the skin. I could not get it to work.

Attachment: default.aspx.zip



DotNetNuke Platinum Benefactor
Mariette Knap - www.smallbizserver.net
John Mitchell
Posts:3369



06/10/2007 9:49 AM  
I didn't see the code in the skin, so I added it and re-attached to this post.

Attachment: default.ascx.zip

Mariette
Posts:102



06/10/2007 1:06 PM  

John,

Well, that works but I had the same code at the same place...never mind...it works now Thanks a million



DotNetNuke Platinum Benefactor
Mariette Knap - www.smallbizserver.net
stefandebie
Posts:5



10/05/2007 6: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
Posts:5



10/08/2007 1:55 AM  
Can anyone help me please?

I am using DNN 4.6.2...

thanks in advance
John Mitchell
Posts:3369



10/08/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>
Please Register to post a reply.
Another benefit of registration is the ability to subscribe to and recieve notifications of new posts.

Forums >DotNetNuke Support >Tips-And-Tricks > Don't load skinobject when certain control loads



ActiveForums 3.7
Visit our Store for great DotNetNuke Modules and Skins
DNNMasters Sitemap/Google Sitemap 3.0

Item codeSM3-01
Price$29.00
Product Information 
DotNetNuke CSS NavMenu 3.3 (Developers)

Item codeCSSNM33DEV
Base Price$149.00
Product Information 
Snapsis PageBlaster 3.3.2 for DotNetNuke - Professional Edition

AuthorJohn Mitchell
Base Price$79.00
Product Information 
XDAkuna (Web 2.0 CSS XHTML Skin)

Item codeXDAkuna
AuthorNina Meiers
Price$49.00
Product Information