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

How to Hide server side control at design time?

Set control'Visible property to false to hide server side control.

For Example:
<asp:Label ID="lbl_employee_id" runat="server" Visible="false"></asp:Label>

<asp:Button ID="btn_reset" runat="server" Text="Reset" Visible ="false"/>

What is the default value of control'Visible value?

True is the default value of control visible property.If we do not provide visible property in control definition,then by-default it consider control as visible = true.
How to Show Hidden server side control at run time?

Set control'Visible property to true to show Hidden server side control.
For Example:
<asp:Label ID="lbl_employee_id" runat="server" Visible="false"></asp:Label>

In code behind in any event or method,write:
lbl_employee_id.Visible = true;

How to disable Asp.Net controls?

By Setting control'Enabled property to False ,we can disable any controls.

For Example:
<asp:Button ID="btn_reset" runat="server" Text="Reset" Enabled="false"/>

How to Enable Asp.Net controls?

By Setting control'Enabled property to True,we can enable any controls.

For Example:
<asp:Button ID="btn_reset" runat="server" Text="Reset" Enabled="true" />

What is the use of &nbsp in HTML?

&nbsp; is used for giving spaces between characters or words.It's in-built HTML property.
For Example:
<P>

&nbsp; &nbsp; &nbsp; &nbsp;Dot Net Funda.com &nbsp;Hello Dot Net Funda.com
</P>

What is the full form of NBSP?

Full form of NBSP is non-breaking spaces also pronounced as no-breaking spaces .
How to give reference to an External style sheet files in HTML pages?

Link tag is used for giving reference to an External CSS file in HTML page.

Syntax:-
<link type="text/css" rel="stylesheet" href="style/common.css" />

Which section is the best place to give reference to an External style sheets?

<HEAD> section is the best place to give reference to an External style sheets in HTML page.

For Example:
<head>
<link type="text/css" rel="stylesheet" href="style/common.css" />
</head>

In which section(s) we can write Javascript functions in an HTML file?

We can write Javascript functions both in <Head> section as well as in <Body> section .

For Example:
<head>

<script type="text/javascript">
function alert_message()
{
alert("hello");
}
</script>
</head>

<body>
<script type="text/javascript">
function alert_message()
{
alert("hello");
}
</script>
</body>

What is the use of <Title> tag in an HTML file?

<Title> tag is used for giving Page Titles.When page is loaded,then we can see the Page Title on Browser Title Bar.
For Example:-
<html>

<head>
<title>
Project Master
</title>
</head>
</html>

In which section we define Title Tag in HTML pages?

We can define Title tag in <Head> section as <Head> section is the best place to have <title> Tag on the page.

For Example:-
<head>

<title>
</title>
</head>

How can we use division section in the HTML page?

We have a <div> tag,which comes under HTML controls and works as a container for the controls.We can place so many controls inside <div> tag.
We can say that it is treated as Parent control and all the controls inside it will be treated as Child controls.
For Example:
<div>

<asp:Label ID="lbl_Error_Msg" runat="server"></asp:Label>
<asp:Button ID="btn_go" runat="server" Text="Go"/>
<asp:CheckBox ID="chk_status" runat="server" />
</div>

What is the use of Panel control in Asp.Net?

Panel control is a server-side control works exactly same as HTML div control.It works as a container for all the Controls which are placed inside it.

Syntax:
<asp:Panel ID="pnl_Modal_Info" runat="server" Width="200px">

<asp:Label ID="lbl_name" runat="server"></asp:Label>
<asp:TextBox ID="TextBox1" runat="server"></asp:TextBox>
</asp:Panel>

What is the purpose of Link-button in Asp.Net?

As we know that,Link-button is a Asp.Net control used for creating a Hyperlink button.It's same as Hyperlink control in Asp.Net.It has a event called Onclick or OnCommand.In short,this control has same functionality as hyperlink control as well as button control.

Syntax:-
<asp:LinkButton Id = "lnk_view" Text = "View" runat="server" />

What does the Causes-Validation property do in Asp.Net?

When we have some validations on our page or control but do not have to perform validation on some control,then we can use CausesValidation property.It has True/False value.Set CausesValidation = False to avoid page validation.
How to make Text font as Italic?

We have a Font-Italic property in Asp.Net controls which is used for setting Text font as Italic.It has True/False property.Set Font-Italic property to true to make font italic.

For Example:-
<asp:TextBox ID="TextBox1" runat="server" Font-Italic="true"></asp:TextBox>

What is the default value of causes-validation property of a control?

Control'CausesValidation property has by-default True property.
How to make Textbox text font as Underline?

We have a Font-Underline property in Asp.Net controls which is used for setting Text font as Underline.It has True/False property.Set Font-Underline property to true to make text underline.

For Example:-
<asp:TextBox ID="TextBox1" runat="server" Font-Underline="true"></asp:TextBox>

How to set Textbox text color?

We have a ForeColor property of TextBox,which is used to set textbox text color to our choice.

For Example:
<asp:TextBox ID="TextBox3" runat="server" Text="Vishal" ForeColor="Blue"></asp:TextBox>

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