Sign In  |  Register
 
 
DotNetNuke Support Forums
Don't load skinobject when certain control loads
Last Post 08 Oct 2007 11:19 AM by John Mitchell. 13 Replies.
Printer Friendly
Sort:
PrevPrevNextNext
Please Register to post a reply.
Another benefit of registration is the ability to subscribe to and recieve notifications of new posts.
AuthorMessages
Mariette
Basic Member
Basic Member
Send Private Message
Posts:100
Avatar

--
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
Veteran Member
Send Private Message
Posts:4133
Avatar

--
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
Veteran Member
Send Private Message
Posts:4133
Avatar

--
05 Jun 2007 06:06 PM  
Did this work out for you Mariette?


Mariette
Basic Member
Basic Member
Send Private Message
Posts:100
Avatar

--
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
Basic Member
Send Private Message
Posts:100
Avatar

--
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
Veteran Member
Send Private Message
Posts:4133
Avatar

--
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
Basic Member
Send Private Message
Posts:100
Avatar

--
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
Veteran Member
Send Private Message
Posts:4133
Avatar

--
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
Basic Member
Send Private Message
Posts:100
Avatar

--
10 Jun 2007 05:19 AM  
Pls, find attached the skin. I could not get it to work.

Attachment: default.aspx.zip

John Mitchell
Administrator
Veteran Member
Veteran Member
Send Private Message
Posts:4133
Avatar

--
10 Jun 2007 09: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
Basic Member
Basic Member
Send Private Message
Posts:100
Avatar

--
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
New Member
Send Private Message
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
New Member
Send Private Message
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
Veteran Member
Send Private Message
Posts:4133
Avatar

--
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>


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


Active Forums 4.1
Visit our Store for great DotNetNuke Modules and Skins
DotNetNuke CSS Menu 3.4.1 (single use)

Item codeCSSNM33SU
AuthorJohn Mitchell
Base Price$39.00
Product Information 
DotNetNuke CSS NavMenu 3.4.1 (Developers)

Item codeCSSNM33DEV
Base Price$149.00
Product Information 
DotNetNuke Performance Caching & Compression - PageBlaster 3.4.5 - Professional Edition

AuthorJohn Mitchell
Base Price$59.00
Product Information