Wrox Programmer Forums
|
BOOK: ASP.NET 2.0 Website Programming Problem Design Solution ISBN: 978-0-7645-8464-0
This is the forum to discuss the Wrox book ASP.NET 2.0 Website Programming: Problem - Design - Solution by Marco Bellinaso; ISBN: 9780764584640
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: ASP.NET 2.0 Website Programming Problem Design Solution ISBN: 978-0-7645-8464-0 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old March 6th, 2009, 06:26 PM
Authorized User
 
Join Date: Mar 2009
Posts: 11
Thanks: 5
Thanked 0 Times in 0 Posts
Question Customize ThemeSelector

I am trying to modify ThemeSelector to have three colored ImageButtons. I have added a onClick"" and not sure what to do. Below is my ASP code in blue and the book's code beside example in red. My plan is to somehow read what ImageButton was clicked and then set the theme accordingly with an if than else or case statement. Do I need a new method or would I add this to the Page_Load method? How do I get the name of what ImageButton was clicked and how do I enable postback?

--- Ryan

<%@ Control Language="C#" AutoEventWireup="true" CodeFile="ThemeSelector.ascx.cs" Inherits="RC.RPC_Group.UI.Controls.ThemeSelector" %>

<asp:ImageButton OnClick="???" ImageUrl="~/images/blueTheme_Box.png" SkinID="blueTheme_Box" ID="blueTheme_Box" runat="server"/>


<asp:ImageButton OnClick="???" ImageUrl="~/images/redTheme_Box.png" SkinID="redTheme_Box" ID="redTheme_Box" runat="server"/>

<asp:ImageButton OnClick="???" ImageUrl="~/images/goldTheme_Box.png" SkinID="goldTheme_Box" ID="goldTheme_Box" runat="server"/>


public partial class ThemeSelector : System.Web.UI.UserControl
{
protected void Page_Load(object sender, EventArgs e)
{
if (Globals.ThemesSelectorID.Length == 0)
Globals.ThemesSelectorID = ddlThemes.UniqueID;

ddlThemes.DataSource = Helpers.GetThemes();
ddlThemes.DataBind();

ddlThemes.SelectedValue = this.Page.Theme;
}
}
 
Old March 6th, 2009, 08:41 PM
Authorized User
 
Join Date: Mar 2009
Posts: 11
Thanks: 5
Thanked 0 Times in 0 Posts
Red face Please Help!

Please Help!!!

I am trying to get this... below is what I have now...

using System;
using System.Collections;
using System.Configuration;
using System.Data;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.HtmlControls;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using RC.RPC_Group;

namespace RC.RPC_Group.UI.Controls
{
public partial class ThemeSelector : System.Web.UI.UserControl
{
string themeName = "";

protected void Page_Load(object sender, EventArgs e)
{
if (Globals.ThemesSelectorID.Length == 0)
Globals.ThemesSelectorID = ddlThemes.UniqueID;

ddlThemes.DataSource = Helpers.GetThemes();
ddlThemes.DataBind();

ddlThemes.SelectedValue = this.Page.Theme;
//themeName = this.Page.Theme;
//Label1.Text = Globals.ThemesSelectorID;
}
protected void blueTheme_Box_Click(object sender, ImageClickEventArgs e)
{
themeName = "blueMidnight";
//if (Globals.ThemesSelectorID.Length == 0)
Globals.ThemesSelectorID = themeName;
Label1.Text = Globals.ThemesSelectorID;
}
protected void redTheme_Box_Click(object sender, ImageClickEventArgs e)
{
themeName = "maroonBlood";
Globals.ThemesSelectorID = themeName;
Label1.Text = Globals.ThemesSelectorID;
}
protected void goldTheme_Box_Click(object sender, ImageClickEventArgs e)
{
themeName = "goldLabel";
Globals.ThemesSelectorID = themeName;
Label1.Text = Globals.ThemesSelectorID;
}
}
}
 
Old March 7th, 2009, 01:08 AM
Authorized User
 
Join Date: Mar 2009
Posts: 11
Thanks: 5
Thanked 0 Times in 0 Posts
Default

Got it~

It was easier than I thought.

--- Ryan





Similar Threads
Thread Thread Starter Forum Replies Last Post
themeselector doesn't show on PlainYellow Rachel BOOK: ASP.NET 2.0 Website Programming Problem Design Solution ISBN: 978-0-7645-8464-0 0 January 7th, 2009 11:05 PM
ThemeSelector class error xrica32 BOOK: ASP.NET 2.0 Website Programming Problem Design Solution ISBN: 978-0-7645-8464-0 4 August 14th, 2007 08:20 PM
Chapter 2 ThemeSelector - Puzzled Porjung BOOK: ASP.NET 2.0 Website Programming Problem Design Solution ISBN: 978-0-7645-8464-0 2 June 11th, 2007 07:43 AM
customize Paula222 ASP.NET 2.0 Professional 0 November 9th, 2006 12:19 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.