ASP.NET Interview Questions and Answers (1544) - Page 66

What is an alternative way of setting background color of an Asp.Net element or controls?

We have control's BackColor in-built property which achieves the same functionality as background-color style property.

For Example:-
<asp:Button ID="btn_go" runat="server" Text="Click Me" BackColor="YellowGreen"/>

<asp:Label ID="lbl_name" runat="server" Text="Name" BackColor="YellowGreen"></asp:Label>

Tell us the difference between BackColor and background-color style property?

Both are used for setting background color of an Asp.Net element or controls but there is only one difference between both.
As we can apply both BackColor and background-color for a server side controls i.e. Asp.net controls but only apply background-color style property for HTML control.
What are the four borders of border-color style property?

top,left,right and bottom are the four borders of border-color property.
What do we mean by border-color:red green blue pink style property?

border-color:red green blue pink means

top border is red
right border is green
bottom border is blue and
left border is pink
What do we mean by border-color:red green blue style property?

border-color:red green blue means:-

top border is red
right and left borders are green
bottom border is blue
What do we mean by border-color:red green style property?

border-color:red green means

top and bottom borders are red
right and left borders are green
What do we mean by border-color:red style property?

border-color:red means all four borders are in red color.
What is the use of border-bottom-left-radius style property in Dot Net?

border-bottom-left-radius style property is an in-built which is used for adding a rounded border to the bottom-left corner of a Div element.

On the other hand,the border-bottom-left-radius property defines the shape of the border of the bottom-left corner.

For Example:-
<style> 

div
{
border-bottom-left-radius:5em;
}

<div>Dot Net Funda Dot Com</div>

What is the default value of border-bottom-left-radius CSS property?

The default value is zero(0) meaning that if we do not provide value to border-bottom-left-radius property,then it takes 0 as default value.
What is the use of border-top-left-radius style property in Dot Net?

border-top-left-radius style property is an in-built which is used for adding a rounded border to the top-left corner of a div element.

On the other hand,the border-top-left-radius property defines the shape of the border of the top-left corner.

For Example:-
<style> 

div
{
border-top-left-radius:5em;
}

<div>Dot Net Funda Dot Com</div>

What is the default value of border-top-left-radius CSS property?

As border-bottom-left-radius,the default value of border-top-left-radius is zero(0) meaning that if we do not provide value to border-top-left-radius property,then it takes 0 as default value.
What is the use of border-top-right-radius style property in Dot Net?

border-top-right-radius style property is an in-built which is used for adding a rounded border to the top-right corner of a div element.

On the other hand,the border-top-right-radius property defines the shape of the border of the top-right corner.

For Example:-
<style> 

div
{
border-top-right-radius:5em;
}

<div>Dot Net Funda Dot Com</div>

What is the default value of border-top-right-radius CSS property?

As border-top-left-radius and border-bottom-left-radius,It has also a 0 as default value.
What is the use of border-left-color property?

It's an in-built CSS property used for setting the color of the left border of any control.

Note:- Always declare the border-style property before the border-left-color property.An element must have borders before you can change the color.

For Example:-
div

{
border-style:solid;
border-left-color:blue;
}

What is the default value of border-left-color property?

The default value is the current color of the element or control which is having any border-left color applied.
What is the use of border-right-color property in HTML?

It's an in-built CSS property used for setting the color of the right border of any control.

Note:- Always declare the border-style property before the border-right-color property.An element must have borders before you can change the color.

For Example:-
input[type="text"]

{
border-style:solid;
border-right-color:green;
}

Why to use border-top-color property in an HTML pages?

When we want to set any element or control Top border color,then we use border-top-color CSS property.It's an in-built CSS property.

Note:- Always declare the border-style property before the border-top-color property.An element must have borders before you can change the color.

For Example:-
div

{
border-style:solid;
border-top-color:red;
}

Why to use border-bottom-color property in an HTML pages?

When we want to set any element or control Bottom border color,then we use border-bottom-color CSS property.It's an in-built CSS property.

Note:- Always declare the border-style property before the border-bottom-color property.An element must have borders before you can change the color.

For Example:-
div

{
border-style:solid;
border-bottom-color:yellow;
}

How to appSettings from web.config file?

Suppose i have a key named File_Path defined in Web.Config file,then to access this key value we will write on code behind as:

string file_path = System.Configuration.ConfigurationSettings.AppSettings["File_Path"];

How to write AppSetting key value in Web.Config file?

We will write Appsetting related keys inside configuration tag as below:-
<configuration>     

<appSettings>
<add key = "File_Path" value="/File" />
</appSettings>
</configuration>

Found this useful, bookmark this page to the blog or social networking websites. Page copy protected against web site content infringement by Copyscape

 Interview Questions and Answers Categories