CodeVerge.Net Beta


   Item Entry   Register  Login  
Microsoft News
Asp.Net Forums
IBM Software
Borland Forums
Adobe Forums
Novell Forums




Can Reply:  No Members Can Edit: No Online: Yes
Zone: > Asp.Net Forum > general_asp.net.web_parts_and_personalization Tags:
Item Type: Date Entered: 9/27/2007 12:50:29 PM Date Modified: Subscribers: 0 Subscribe Alert
Rate It:
NR
XPoints: N/A Replies: 3 Views: 40 Favorited: 0 Favorite
4 Items, 1 Pages 1 |< << Go >> >|
"getmedomi" <>
NewsGroup User
theme changing using webpart control9/27/2007 12:50:29 PM

0

hi all..

           how to change themes dynamically using webpart control.

 can i get a sample code for that..............

thanks....
 

"ScottyB" <>
NewsGroup User
Re: theme changing using webpart control9/27/2007 1:54:45 PM

0

Here is some sample code for dynamically changeing themes . I got this from a book I am presently reading called "Pro ASP.NET with VB.NET 2005" . 

 Hope you find this useful

ASPX PAGE.

<%@ Page Language="VB" AutoEventWireup="false" CodeFile="DynamicThemes.aspx.vb" Inherits="Chapter15_DynamicThemes" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
    <title>Applying Themes Dynamically</title>
</head>
<body>
    <form id="form1" runat="server">
    <div>
        <asp:ListBox ID="lstThemes" runat="server" />
        <br />
        <br />
        <asp:Button ID="btnSubmit" runat="server" Text="Change Theme" />
     </div>
    </form>
</body>
</html>

Code Behind

Imports System.IO

Partial Class Chapter15_DynamicThemes
    Inherits System.Web.UI.Page

    Protected Sub Page_PreInit(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.PreInit
        If Session("Theme") Is Nothing Then
            Page.Theme = String.Empty
        Else
            Page.Theme = Session("Theme").ToString()
        End If
    End Sub

    Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
        If (Not Page.IsPostBack()) Then
            ' Fill the listbox with available themes by reading the folders in the App_Themes folder
            Dim themeDir As New DirectoryInfo(Request.PhysicalApplicationPath() & "\" & "App_Themes")
            lstThemes.DataTextField = "Name"
            lstThemes.DataSource = themeDir.GetDirectories()
            lstThemes.DataBind()
        End If
    End Sub

    Protected Sub btnSubmit_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles btnSubmit.Click
        ' Set the chosen theme
        Session("Theme") = lstThemes.SelectedValue

        ' Refresh the page
        Server.Transfer(Request.FilePath())
    End Sub
End Class
 
"getmedomi" <>
NewsGroup User
Re: theme changing using webpart control9/27/2007 2:05:23 PM

0

 thank you for ur rply sir..

But i need to do it using webpart zone.

ie...i have a drop down box in my webpart zone.I have set its auto post back property true.

When i change the selected item, the page theme should be the selected theme. This is my need.

"Amanda Wang -
NewsGroup User
Re: theme changing using webpart control10/4/2007 7:29:54 AM

0

Hi,

Base on your description, you want the user to selected theme from the dropdownlist items?

You can try to read this MADN article: Walkthrough: Creating User-Selectable Themes 

Hope it helps


Please remember to mark the replies as answers if they help and unmark them if they provide no help.


Yours sincerely,
Amanda Wang
Microsoft Online Community Support
4 Items, 1 Pages 1 |< << Go >> >|


Free Download:













snowcovered portal store configuration?

new: tttforum & tttgallery (application pack) 1.0.10 private assembly

repeater and paging

help: can not open the solution or the project file

advanced news feed

extending user and address dnn controls

free module - amazon related products

survey module

crystal reports in dnn

how to popup a window and get postback values?

problems with navigateurl for hyperlink column

package module

reinstall core module

dnn - ecom store module - plz help !!!

tttcompany - ttt forum

inheriting from portalmodulecontrol

help with registration module in dnn 3.1

bound editable datagrid with radiobuttons

[dnn2] portal store 6.2.1 - anybody tried successfully to change the codes and recompile it?

dnn chat module

sending to search engines

facing strange problem in dotnetnuke 4.8.2

where is the end of shaun walker's tutorial on dnn 4 starter kit ?

user online problem dnn 3.10

dnn 3 - module development - can't inherit portalmodulebase issue

weather module

converted rainbow "shortcut" module

help with + signs being removed from scripts during install

modules and data access method

can any body help me???????

asp.net 2.0 & dnn 4 - redundancy/overlap?

can you restrict custom modules by portal?

solpartactions giving me hassles

using datasets with the dal

daily comic and multi-html for dnn3

dnn3.0.12 drops to login screen now and then for no reason?

creating a custom module

analytical site gauge

lf - event registration and payment module

testers for speerio photo viewer

a light weight ecommerce module released

cbo question

editurl to new control besides "edit"

rss feed agregator?

code behind question

formcreator to xmod

new modules available for download

poor-man's repository

looking for a module for classified ads

adding a module does nothing

   
  Privacy | Contact Us
All Times Are GMT