Products

Solutions

Resources

Partners

Community

Blog

About

QA

Ideas Test

New Community Website

Ordinarily, you'd be at the right spot, but we've recently launched a brand new community website... For the community, by the community.

Yay... Take Me to the Community!

Welcome to the DNN Community Forums, your preferred source of online community support for all things related to DNN.
In order to participate you must be a registered DNNizen

HomeHomeArchived Discus...Archived Discus...Developing Under Previous Versions of .NETDeveloping Under Previous Versions of .NETASP.Net 2.0ASP.Net 2.0How to change background of a page progamatically from a moduleHow to change background of a page progamatically from a module
Previous
 
Next
New Post
3/10/2008 7:19 AM
 

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 8:45 PM
 

Any ideas?


Entrepreneur

PokerDIY Tournament Manager - PokerDIY Tournament Manager<
PokerDIY Game Finder - Mobile Apps powered by DNN
PokerDIY - Connecting Poker Players

 
New Post
3/19/2008 5:34 AM
 

   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.


Over 20 + professional dnn modules for News Article, Store, Video Gallery, Photo Gallery, Ultra Flash Player,YouTube Video, Image Slide show, Skin Chameleon and much more from DnnModule.com
 
New Post
3/27/2008 8:13 PM
 

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


Entrepreneur

PokerDIY Tournament Manager - PokerDIY Tournament Manager<
PokerDIY Game Finder - Mobile Apps powered by DNN
PokerDIY - Connecting Poker Players

 
New Post
5/26/2008 4:17 AM
 

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

 
Previous
 
Next
HomeHomeArchived Discus...Archived Discus...Developing Under Previous Versions of .NETDeveloping Under Previous Versions of .NETASP.Net 2.0ASP.Net 2.0How to change background of a page progamatically from a moduleHow to change background of a page progamatically from a module


These Forums are dedicated to discussion of DNN Platform and Evoq Solutions.

For the benefit of the community and to protect the integrity of the ecosystem, 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 DNN.
  2. No vendor trolling / poaching. If someone posts about a vendor issue, allow the vendor or other customers to respond. Any post that looks like trolling / poaching will be removed.
  3. Discussion or promotion of DNN Platform product releases under a different brand name are strictly prohibited.
  4. No Flaming or Trolling.
  5. No Profanity, Racism, or Prejudice.
  6. Site Moderators have the final word on approving / removing a thread or post or comment.
  7. English language posting only, please.
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out