Small width layout Medium width layout Maximum width layout Small text Medium text Large text
     Search
Downloads Downloads Directory Directory Forums Forums Forge Forge Blogs Blogs        Marketplace Marketplace Careers Program Careers
Community › Forums Register  |  

$4.95 Windows Hosting at Webhost4life.com
  Need Help?  
Professional technical support for DotNetNuke is available from DotNetNuke Corporation.
 


  Ads  
Aspose - The .NET & Java component publisher
 


  Sponsors  

Meet Our Sponsors

ExactTarget email software solutions
Merak Mail Server
WebSecureStores -- ASP.NET & DotNetNuke Hosting Solutions
FCKeditor Project
Salaro -- Skins and more
OnyakTech
 


DotNetNuke Forums
 
  Forum  General DotNetN...  Extend It! ( Pr...  How to change background of a page progamatically from a module
Previous Previous
 
Next Next
New Post 3/10/2008 4:19 AM
Unresolved
User is offline Rodney Joyce (Can't Post with old Account)
49 posts
10th Ranked


How to change background of a page progamatically from a module 

Hi,

I am looking for a way to set a background image on the page from within a module. I don't even know if this is possible, but I don't want to use the skinning engine - I just want to set the IMG source of the top level table to a background image (I think).

I am just messing around at this point - I tried

((System.Web.UI.TemplateControl)((DotNetNuke.Framework.CDefault)this.Page))

to get a handle to the main page and see if I could insert some HTML somewhere (like "<TABLE id="tab" background='xyz.gif'>") but I'm not having any joy - any ideas on how I could achieve this?  I think I may be looking at the problem too cloesly and need to go back to basic HTML/Jscript etc.

 

 

 


Thanks,
Rodney
Smart-Thinker - Social Networking modules for DotNetNuke
The DotNetNuke Directory - Are you listed?
PokerDIY - Example Implementation of DNN Social Network
Do use DNN a lot? Try the DotNetNuke Toolbar to save you time!
 
New Post 3/18/2008 5:45 PM
User is offline Rodney Joyce
1450 posts
www.smart-thinker.com
6th Ranked




Re: How to change background of a page progamatically from a module 

Any ideas?


Thanks,
Rodney
Smart-Thinker - Social Networking modules for DotNetNuke
The DotNetNuke Directory - Are you listed?
PokerDIY - Example Implementation of DNN Social Network
Do use DNN a lot? Try the DotNetNuke Toolbar to save you time!
 
New Post 3/19/2008 2:34 AM
User is offline xiao qi
110 posts
www.DnnModules.cn
9th Ranked






Re: How to change background of a page progamatically from a module 

   There is a option you can manully update page background in "Admin"-"Site Settings" - "Appearance settings " - "background image". So , I think you can try read the source code to see how dnn core to handle this.  Below is the code from default.aspx.vb
        'set the background image if there is one selected
            If Not Me.FindControl("Body") Is Nothing Then
                If PortalSettings.BackgroundFile <> "" Then
                    CType(Me.FindControl("Body"), HtmlGenericControl).Attributes("background") = PortalSettings.HomeDirectory & PortalSettings.BackgroundFile
                End If
            End If

       Wish it can help.

 
New Post 3/27/2008 5:13 PM
User is offline Rodney Joyce
1450 posts
www.smart-thinker.com
6th Ranked




Re: How to change background of a page progamatically from a module 

Thanks for the tip - this is the kind of thing I was looking for!


Thanks,
Rodney
Smart-Thinker - Social Networking modules for DotNetNuke
The DotNetNuke Directory - Are you listed?
PokerDIY - Example Implementation of DNN Social Network
Do use DNN a lot? Try the DotNetNuke Toolbar to save you time!
 
New Post 5/26/2008 1:17 AM
User is offline Timo Breumelhof
1626 posts
5th Ranked




Re: How to change background of a page progamatically from a module 

Hi Rodney.

This would write some style to to the head of the page (and it is XHTML compliant):

        Dim sStyle = String.Concat("body {background-image:url(", PortalSettings.HomeDirectory, "logo.gif)}")
        Dim oCssLink As New HtmlGenericControl("style")
        oCssLink.Attributes("type") = "text/css"
        oCssLink.InnerHtml = sStyle
        Dim oCSS As Control = Me.Page.FindControl("CSS")
        If Not oCSS Is Nothing Then
            oCSS.Controls.AddAt(0, oCssLink)
        End If


Timo Breumelhof -- www.searchdotnetnuke.com -- Extended DNN (forum) search
 
Previous Previous
 
Next Next
  Forum  General DotNetN...  Extend It! ( Pr...  How to change background of a page progamatically from a module
 


Forum Policy

These Discussion Forums are dedicated to the discussion of the DotNetNuke Web Application Framework.

For the benefit of the community and to protect the integrity of the project, please observe the following posting guidelines:

1. No Advertising. This includes promotion of commercial and non-commercial products or services which are not directly related to DotNetNuke.
2. Discussion or promotion of DotNetNuke product releases under a different brand name are strictly prohibited.
3. No Flaming or Trolling.
4. No Profanity, Racism, or Prejudice.
5. Site Moderators have the final word on approving/removing a thread or post or comment.
6. English language posting only, please.

 


DM Analytics, LLC
DM Analytics, LLC provides software solutions that facilitate rapid development of independent or dependent datamarts and their associated web-based reporting.
www.dmanalytics.com
Integral Hosting | DNN only $14.95/month
Experienced .NET hosting on Windows 2003, ASP.NET 1.1 & 2.0, MSSQL with real technical support.
www.integralhosting.com
Aricie
Aricie is one of the French pioneers and experts in DotNetNuke technology.
www.aricie.com

DotNetNuke Corporation   Terms Of Use  Privacy Statement
DotNetNuke®, DNN®, and the DotNetNuke logo are trademarks of DotNetNuke Corporation
Hosted by MaximumASP