change back ground color

Hi 

I was wondering how do i change the back ground color of my aspx page during runtime.
Ex User has a drop down box and he can select color.
I am using Visual studio editor.In my application i am using an external style sheet the one provided by Visual Studio.
thnks
0
frank1111
10/13/2003 3:33:40 PM
asp.net.client-side 24353 articles. 2 followers. Follow

2 Replies
1178 Views

Similar Articles

[PageSpeed] 16
Get it on Google Play
Get it on Apple App Store

You can do that with some javascript. To get the value from the dropdown, you'd use an OnChange event. Then refrence it by saying the name of the form, the name of the element, and the value like this:
document.bgcolor = formname.elementname.value;

Jason N. Gaylord
ASPInsider and Microsoft MVP
http://jasongaylord.com
0
j_gaylord
10/13/2003 3:39:28 PM
Hi

I can't seem to reference any html tags like <p> or <body id attributes from my Visual Basic
Code editor.
Secondly I tried from my html editor to call a function from the on load method
kept getting errors
I also tried using <% %> these, still nothing
What i was trying to do was call a function from my <Body onload> method that was defined
in my visual basic code editor file.
I seen this done in the tutoriols offered by this site.
The difference is they use a text editor, and define both the html and Visual basic on the same file.
I am using Visual studio.
If use Javascript on a aspx file do you define the javascript on the server?
0
frank1111
10/13/2003 9:46:13 PM
Reply:

Similar Artilces:

Changing client side cookies in .NET
I have a few cookies in my applicaiton which are created using javascript. Now I can read the cookies no problem. I can create the cookies in .NET and read them in javascript no problem. If the cookie is created in .NET i can modify it's value in .NET no problem. If the cookie is create in javascript I can modify it's value in javascript no problem. What I can't do is change the value of a cookie created in javascript using .NET. I have tried every permutation of Cookies.Add, Cookies.Set, Cookies.Remove using both the response and request objects. I can debug the code and see ...

Client side changes not persisted on post back.
A page has list box control and at client side user can rearrange the items in that list box. But after rearranging items, when page is posted back, the rearranged items are not displayed in rearranged order but are shown in the order that were returned on first page load. Any idea how to keep rearranged items in order even on post back. Please help! Thanks,Mahesh  ASP.NET does not remember client side changes as ASP.NET is a server side language.If you want to persist the changes done on client side you will need to record it into a hidden field, and then read the hidden field on...

Pass client side changes back to server
Hi I have added a simple javascript in the head of my page to prompt a user to enter a new item and add that item to a checkboxlist using the outerhtml command. All it does is adjust the outerhtml to include the new list item 'checked' at the end of the list. The script works fine and the page displays the edited list. The user can add as many items as they wish. But when the save button is selected at the end. The server only knows of the original list items. Not the new user entered items. I don't know how to pass the items back to the server at the end. Can anyone help p...

Detail Data should be given white and yellow back ground for each row (back ground color BLOCKED EXPRESSION
How can i set the background expression in the code for generating the RDL dynamically i tried this writer.WriteElementString("BackgroundColor", "=IIf(Mod(RowNumber,2)=1,'White','PaleGoldenrod)"); but this is not applied to all my columns. It says the expression contains error. Please let me know how i can set the back ground color expression. Hi,  Please let me know how i can set the back ground color expression   You can select the specific column you want, and right click on it ,choose properties, then a property window would app...

changeing back ground color based on Data base information
I am filling a data set with data from a data base table and I created a boolean colum in my table. I was wondering if there is a way to change the background color of a datagrid column based on whether that value is true or false?   Thanx, Adam Here's one with a GridView for example:http://weblogs.asp.net/sushilasb/archive/2006/01/27/436720.aspxAnd here's one with a DataGrid:http://www.dotnetjunkies.com/Article/AB92FE75-4C0A-4DDB-94FA-0F14C64DD281.dcikDarrell Norton, MVPDarrell Norton's BlogPlease mark this post as answered if it helped you! thanks :)...

Using client-side code to change color of a row in a datagrid?
I am interested in changing the color of the row that a a user is trying to delete. When  user clicks on the delete button, client side code causes a confirmation box asking 'Are you sure you want to delete?' and I want to add to this,  javascript code that will change the color of the row user intends to delete. Can some help me in how I can do this?sun21170 If you are posting back to do the confirmation, then you can most likely use the selected row property   But if you are using JavaScript added to the button to do the confirm, you can try something lik this, make sur...

Validation Controls in .NET ( Client side or server side?)
 i have a very basic question. We have all these validation controls in asp.net ( required field, range validator and others)..my question is the required field validator is a server side control. So does that mean that it does a post back?..is it client side or server side control  The only controls that post back are buttons and other inputs where you set AutoPostback="True", such as a dropdownlist or a textbox.  Another way of posting back is using an UpdatePanel and placing a trigger in it for a specified control and/or event. All controls are considered clien...

Jscript, moving from client-side to server-side (.NET)
Hey all I’m working translating a web-app written in client-side Jscript to run on the server-side as JScript.NET. Without needing to get too specific, I am using Jscript because the original page aggregated raw data to produce statistical results (this was done dynamically based on user 'sort-by' options). The final output is an html report that can be emailed. Because this is currently being done on the client side, as the raw data grows the load-time grows as well (to the point that has almost become unusable). I’m posting here to see if anyone has any experi...

Changing Server-Side Control Properties by Client-Side
Hi, I have 4 server side button control. These are for choices of a competition website(A,B,C,D) and I have 1 client side button control named "Changer" on the same page. When I click the Changer I want it to disable A, if it is disabled I want it to disable B... The main question in this topic is "How can I change properties of a server-side control by client-side" My javascript side is not very well. How can I do this? Please help me. I got it guys. Thank You very much.. Hi, Here is the javascript for enable and disable two server side buttons with id Button1 and Butt...

FormView control
When a user modifies the value in a textbox in a "EditTemplate" of the Form View, I would like the font color or back color of the text box to change - even before the update is submitted. How can I do that? Thanks. You can add an onchange event to your textbox: onchange="this.style.backgroundColor='yellow';" Or use the onkeyup event as well. You may need to add the handler for this if your textbox box is being created in the client side.Please mark as "answer" if this helped you in anyway. Thanks. here is how I did it:Protected Sub FirstName...

Client side pass data back to Server side
Hey, just some simple questions. In tranditional ASP, I can easyly get data from client side script simply by place data in <input type="hidden"> tag...and get it back by request.form() on the server side. And what will be the possible way to achieve this without using cookies?? There is a Request.Form() in ASP.net, how ever how can I post client side data back...what what is the action target? webapplication.asp...???? Thanks for your help, Lin. So what is wrong with this approach in ASP.NET?Leon LangleybenMCSD, ASP.NET MVPBlog Dear Lin, You a...

When to use client side varidation and server side varidation in .net?
In .net or classic web application we can varidate user data either on client isde or server side. How to select which side varidate to be used? Thanks! Generally, I use both client and server validation. I make sure the input is in the correct format and reasonably valid on the client, then I verify the data on the server. The extent of validation also depends on the type of data that I need to validate.Here are a few references:Validating ASP.NET Server ControlsIntroduction to Validating User Input in Web FormsClient-Side Validation for ASP.NET Server ControlsSecurity Checklist...

back ground color is not loaded every time on post back.
I have a menu as a usercontrol which have background color and some text styling. I have learned that some time on post back the color is not appearing but the text seems to allways do it. Why is that? And how do I work around it. My style sheet contains: .infTable_Header{ BACKGROUND: #96b6cc; width: 100%; } ..infTableTd1_Header { vertical-align: baseline; margin:0; padding:0; font-size:25pt; width: 350px; } ..infTableTd2_Header { vertical-align: baseline; margin:0; padding:0; font:italic; font-size:20pt; width:300px; } This refers to a table in...

change control property from client side and have changes persist on the server
Hi I was wondering if it was possible to change a control's property from the client side with javascript without a post back and have those changes be reflected on the server when a post back occurs. Such as if I had a label and I change it's text property with javascript without a post back and when a post back occurs I can grab those changes on the server e.x. string labelText = label1.Text;  When using input controls (textbox, select etc) then it's definitely possible. But when using labels (which will be rendered as <span> tags) then I'm not sure they ...

Web resources about - change back ground color - asp.net.client-side

Change Congress - Wikipedia, the free encyclopedia
Change Congress is an American organization that aims to end perceived corruption in the United States Congress by reducing what it considers ...

Longer breeding seasons, more kittens: are cats reacting to climate change?
&quot;There's just kittens coming out of everyone's ears.&quot;

Corvids could save forests from the effects of climate change
A raven with a large seed, about to bury it in a field. (credit: Callum Hoare / Flickr ) To you, crows and jays might be noisy, obnoxious birds ...

This invention could completely change the way we drink beer at home
A couple of years back, I wrote about SYNEK , an exciting Kickstarter project that had the potential to change the way we drink beer at home. ...

Dealing With Generational Change at VC Firms
... . But there was another element that was very subtle and nicely handled that I’d like to expand upon. Dan asked Fred about “generational change” ...

The drone industry will change the way we do business ― but first it needs to grow up
... save lives, lower costs, improve performance, and reduce waste. Their advanced cameras and data processing and analytics tools can detect changes ...

Users await possible Twitter feed change
Twitter users are waiting to see what changes, if any, will hit their feed this week. BuzzFeed reported Friday that a "brand new Twitter" is ...

NH Republicans a good match on climate change wackiness with Cruz, Trump, and Rubio
In a less insane world, Donald Trump, Ted Cruz, and Marco Rubio’s views on climate change would be enough to scrub them right out of the race ...

World's Best Cycling Team Disinvited From Tour Of Qatar Because They Take Too Long To Change
... squad, and they’ve cleaned up. But they won’t be going this year, because the race’s owners are unhappy with their costume changes. Read more... ...

Climate Change Is Leaving Native Plants Behind
Animals and weeds are bounding up California's warming hills, while native plants are stuck in place.

Resources last updated: 2/8/2016 11:11:08 PM