.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
 
Sign In
Register
 
Win Surprise Gifts!!!
Congratulations!!!


Top 5 Contributors of the Month
david stephan

Home >> Interview Question >> JavaScript/VBScript >> Post New Question Subscribe to Interview Questions

How to change style on an element?

Posted By :Akhil Raj     Posted Date :September 21, 2010    Points :10   Category :JavaScript/VBScript 
Between CSS and javascript is a weird symmetry. CSS style rules are layed on top of the DOM. The CSS property names like "font-weight" are transliterated into "myElement.style.fontWeight". The class of an element can be swapped out. For example:
document.getElementById("myText").style.color = "green";
document.getElementById("myText").style.fontSize = "20";
-or-
document.getElementById("myText").className = "regular";

You can also find related Interview Question to How to change style on an element?  below: 

How can we change priority and what the levels of priority are provided by .NET ?

  
Thread Priority can be changed by using Threadname.Priority = ThreadPriority.Highest. In the sample provided look out for code where the second thread is ran with a high priority.
Following are different levels of Priority provided by .NET :-
. ThreadPriority.Highest
. ThreadPriority.AboveNormal
. ThreadPriority.Normal
. ThreadPriority.BelowNormal
. ThreadPriority.Lowest (More...)

Is Ajax a technology platform or is it an architectural style?

  
Its both. Ajax is a set of technologies being used together in a particular way. (More...)

Does SessionID change with every request in the asp.net 2.0 application?

  
Answer:
For any web programmer, its obvious to think and believe that SessionId remains same through out the user session and it was right till asp.net1.1. But in asp.net2.0, this behavior has changed. In the asp.net application new sessionid is returned with the response to every request until session objects are not used.

According to MSDN the reason/solution is:

"When using cookie-based session state, ASP.NET does not allocate storage for session data until the Session object is used. As a result, a new session ID is generated for each page request until the session object is accessed. If your application requires a static session ID for the entire session, you can either implement the Session_Start method in the application's Global.asax file and store data in the Session object to fix the session ID, or you can use code in another part of your application to explicitly store data in the Session object."


Enjoy. (More...)

Can you change the value of a variable while debugging a C# application?

  
Yes, if you are debugging via Visual Studio.NET, just go to Immediate window. (More...)

Explain inline, embedded and external style sheets .

  
There are three ways of inserting a style sheet:

1. External style sheet
2. Internal style sheet
3. Inline style

External Style Sheet :
An external style sheet is ideal when the style is applied to many pages.
With an external style sheet, you can change the look of an entire Web site by changing one file.
Each page must link to the style sheet using the tag. The tag goes inside the head section:




Internal Style Sheet :
An internal style sheet should be used when a single document has a unique style. Internal styles sheet needs to put in the head section of an HTML page, by using the


Inline Styles :
If only a small piece of code has to be styled then inline style sheets can be used.
An inline style loses many of the advantages of style sheets by mixing content with presentation.
To use inline styles you use the style attribute in the relevant tag.
The style attribute can contain any CSS property.
The example shows how to change the color and the left margin of a paragraph:

This is a paragraph.

(More...)

What is embedded style? How to link?

  
The HEAD area, where the TITLE and META tags are found, is also used to store CSS commands.
These are called embedded CSS. Any embedded CSS command will over-ride an external CSS command of the same tag. Embedded commands are more specific to the page.

Embedded CSS codes are placed within the HEAD area of the page code. That is anywhere after the tag and before the tag. NOT in the HEAD tag itself.



Now, whenever any of those elements are used within the body of the document, they will be formatted as instructed in the above style sheet. (More...)

How can we change the default port?

  
From the Network Utility TCP/IP properties -> Port number.both on client and the server. (More...)

Can you change the value of a variable while debugging a C# application?

  
Yes, if you are debugging via Visual Studio.NET, just go to Immediate window. (More...)

How to change the default page of a Silverlight application?

  
In a simple way we can set the default page, what we have to do is to change the default page of a silverlight application, we have to set the RootVisual property inside the Application_Startup event of the App.xaml file.


private void Application_Startup(object sender, StartupEventArgs e)
{
this.RootVisual = new MainPage();
}
(More...)

Quick Links For Interview Questions Categories:
ASP.Net Windows Application   .NET Framework   C#   VB.Net   ADO.Net  
Sql Server   SharePoint   Silverlight   OOPs   JQuery   JavaScript/VBScript
Biztalk Patten/Practices .IIS WCF WPF WWF
Networking Aptitude Others   All      

Find questions, FAQ's and their answers related to .NET, C#, Vb.Net, Sql Server and many more.

 
Now you can find lots of .NET, C#, Vb.Net, SQL Server,Windows, ASP.Net related Questions and their Answers here at www.dotnetspark.com. Our aim is to help you pass your certification Exams (MCP, MCSD, MCAD etc.,) with flying scores and get good name in your company.

So, Start looking our Interview Question section daily and improve your .NET Skills. You can also help others by posting Interview Questions and their Answers in this section.


Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend