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  |  

AppTheory specializes in solutions based on the DotNetNuke platform and has 2 employees on the DotNetNuke Core Team.
  Need Help?  
Professional technical support for DotNetNuke is available from DotNetNuke Corporation.
 


  Ads  
WebHostForAsp.net
 


  Sponsors  

Meet Our Sponsors

SteadyRain
DataSprings - Great Ideas. Always Flowing.
R2integrated - formerly bi4ce
Jango Studios - Skins, Modules and Hosting for DotNetNuke
eUKhost.com is commited to offer exceptional UK Windows Web Hosting solutions with quality 24x7 technical support.Our plans support ASP.Net, ASP, ASP.NET Ajax extensions, XML, MSSQL, MySQL, PHP,DNN, multiple domains and Shared SSL as standard.
SmarterTools
 


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
1451 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
1451 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
1628 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.

 


PointClick DotNetNuke Solutions
PointClick Technologies provides high-end DNN Hosting for businesses.
PointClick.Net Hosted Solutions
Active Modules, Inc.
Creators of Active Forums, the best forum module for DotNetNuke
www.activemodules.com
DotNetNuke Marketplace - Modules & Skins
The DotNetNuke Marketplace is the official e-commerce gateway for the DNN ecosystem. It's the place to buy and sell DotNetNuke modules, DotNetNuke skins, and other DNN offerings.
DotNetNuke Marketplace

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