473,765 Members | 1,909 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Changing bgcolor in Master Page

39 New Member
Hi

I have a master page with <TD> columns defined in the table as <td bgcolor="#51864 3"> (which means bgcolor="green" ). In one of my content pages, I have a dropdown with values such as blue, green. In that, if I select the value as blue, then all <TD>'s in Master page with bgcolor="#51864 3" should change as green. So that the use can customize their page according to their color selection.
Sep 27 '08 #1
2 1458
xend
8 New Member
Make a method in the master page class that receives a color and then changes the tds bgcolor (td probably must be runnat="server" ). Then in the content page call that method of the masterpage.

void Page_Load(objec t sender, EventArgs e) //content page load event
{
Master.changeTD Color(Color);// changeTDColor is the method created in the master page.
}
Oct 1 '08 #2
Curtis Rutland
3,256 Recognized Expert Specialist
The problem is that what you set won't persist. You might be able to change it for one page load, but the next page you load, it will load the default master page. What you need to do is use cookies.

When a user selects a color, save that color to a cookie. And in your master page's Page_Load method, check for that cookie. If it exists, get the color from it and use it as the bgcolor (although using CSS is preferable now), otherwise, use a default color.
Oct 1 '08 #3

Sign in to post your reply or Sign up for a free account.

Similar topics

31
5722
by: Arthur Shapiro | last post by:
I'm the webmaster for a recreational organization. As part of one page of the site, I have an HTML "Calendar at a Glance" of the organization's events for the month. It's a simple table of a calendar, 7 across by whatever needed down, and I manually create it each month - not a big deal. Every day I go in and darken the background color of the current day's cell by changing the appropriate <TD> entry to <TD bgcolor="c63800"> and...
6
1473
by: GaryDean | last post by:
I need to be able to change the background color of a page from code. I found an answer to this question in another forum from Peter Huang that said that an id="bg" as follows... <body MS_POSITIONING="GridLayout" runat="server" id="bg"> then we could do the following in our codebehind file.... Private Sub Page_Load(sender As Object, e As System.EventArgs) bg.Attributes.Add("BgColor", "#ff9933")
12
4553
by: GaryDean | last post by:
In the original post I failed so indicate that I am using framework 1.1....... I need to be able to change the background color of a page from code. I found an answer to this question in another forum from Peter Huang that said that an id="bg" as follows... <body MS_POSITIONING="GridLayout" runat="server" id="bg"> then we could do the following in our codebehind file....
1
4532
by: rbinington | last post by:
Hi, I am trying to write a DNN module that has the ability to insert articles into an article repository. I want the users to be able to move pages around and enter text into the FCKEditor. I want only one instance of the FCKEditor on the screen at one time so I make tabs that the user can click and I store the values in variables behind the scenes. I change the CSS class on the link that is the currently selected one. I have a really...
3
2474
by: ml41782 | last post by:
I have a solarr grid tie system. the power data is dumped in xml. using xsl I want to change the color of the field based on the data going positive ( power from the grid ) or negative ( solar is pushing power to the grid ) I have been trying diffferent things and it just doesn't work. What am I missing ? <table border="3"> <tr bgcolor="#9acd32"> <th bgcolor="#ffff55" aligh="center" colspan="4">Current System...
2
1714
by: Stratum | last post by:
It's an old question, and I apologize for raising it again. I use ImageButton objects on my ASP.Net master page to navigate to content pages. For each button, I have two images. One image shows black print on a white background, and the other image shows the same printing in white on a red background to indicate the content page which is presently loaded. When I navigate between pages, I want the
4
3356
by: gubbachchi | last post by:
Hi all, Please anybody help me solve this problem. I am stuck up with this from past 2 weeks. I am developing an application where, when the user selects date from javascript datepicker and enters the comments and clicks the save button then the date and the date will be stored in the mysql database. This is working fine. But my problem is when, after the user had made an entry the date in the calendar for which an entry has made should be...
4
1828
by: Torben Laursen | last post by:
I want to change the label of a component that I have on a masterpage but I cannot get my hands on it I have a mastepage MP2 that has a button called B2 masterpage MP2 uses masterpage MP1 that has a button called B1 I then have a page called default and in the page load I tryed: System.Web.UI.WebControls.Button B10 = (System.Web.UI.WebControls.Button)Master.FindControl("B1"); System.Web.UI.WebControls.Button B20 =...
1
1871
by: Sinan Alkan | last post by:
In a master page --content page system, is it possible to change the "description" and "keywords" meta tags of the master page from content page ? I am trying as follows, from content page.... protected void Page_Load(object sender, EventArgs e) { HtmlMeta fordesc = new HtmlMeta(); fordesc.Name = "keywords";
0
10007
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
9946
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9832
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
1
7371
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
0
6646
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
0
5272
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
1
3921
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3530
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2800
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.