Вы находитесь на странице: 1из 18

1) To set page title dynamically in ASP.NET which of the following is used?

a) None of the above


b) < sheet > section
c) < tail > section
d) < head > section (ANS)
2) In ASP.NET application the Global.asax file lie in which directory
a) Application
b) System
c) ROOT (ANS)
d) None of the Above
3) Which of the following can be used to debug .NET application?
a) Systems.Diagnostics classes
b) Runtime Debugger
c) Visual Studio .NET
d) All the Above (ANS)
4) Which of the following is used to write error message in event Log File?
a) System.Data
b) System.EnterpriseServices
c) System.Diagnostics (ANS)
d) None of the Above
5) Setting the following properties for object in ASP.NET results in Response.Buffer = True
Response.ExpiresAbsolute = Now().Subtract(New TimeSpan(1, 0, 0, 0)) Response.Expires = 0
Response.CacheControl = "no-cache"
a) Avoid page to be cached (ANS)
b) Clears the buffer area
c) The session expires
d) None of the Above
6) Which of the following denote value that can be taken by Cache-Control of ASP.NET?
a) Public
b) Private
c) no-cache
d) All the Above (ANS)
7) In ASP.NET page framework an automatic way to associate page events and methods is
a) AutoEventWireup attribute of the Page directive is set to true
b) AutoEventWireup attribute of the Page directive is set to False
c) It is not possible to set automatically page events and methods
d) None of the Above
8) In ASP.NET if one wants to set the focus on a particular control
a) Call SETFOCUS
b) Call SETCONTROL
c) Call FOCUS method (ANS)
d) None of the above
9) The control used in ASP.NET to display information from data set but with better formatting and editing
behavior is

a) Pane
b) Button
c) DataList (ANS)
d) None of the Above
10) Which of the following languages can be used to write server side scripting in ASP.NET?
a) C# (ANS)
b) C
c) Visual Basic
11) The Following are the minimum requirement to run Asp.net pages
a) Java Virtual Machine
b) Common Language Runtime (ANS)
c) Windows explorer
12) When a .aspx page is requested from the web server, the out put will be rendered to browser in following
format.
a) HTML (ANS)
b) XML
c) WML
13) What executable unit gets created when we build an ASP.Net application?
a) . DLL (ANS)
b) . EXE
c) . COM
14) The best way to delimit ASP.Net code from HTML code in your pages is by using --------------- tags.
a) < Body >
b) < Head >
c) < Script > (ANS)
15) The Asp.net server control, which provides an alternative way of displaying text on web page, is
a) < asp:label > (ANS)
b) < asp:listitem >
c) < asp:button >
16) asp:dropdownlist> tag replaces which of the HTML tags
a) < Option >
b) < Select > (ANS)
c) < List >
17) < asp : listitem > tag replaces which of the following HTML tags
a) < Option > (ANS)
b) < UL >
c) < List >
18) The first event to be triggered in an aspx page is
a) Page_Load()
b) Page_Init()(ANS)
c) Page_click()

19) Postback occurs in which of the following forms


a) Winforms
b) HTMLForms
c) Webforms (ANS)
20) what namespace does the Web page belong in the .NET Framework class hierarchy?
a) System.web.UI.Page (ANS)
b) System.Windows.Page
c) System.Web.page
21) Which method do you invoke on the Data Adapter control to load your

generated dataset

a) Fill ( ) (ANS)
b) ExecuteQuery ( )
c) Read ( )
22) How many configuration files can an ASP.NET projects have?
a) More Than One
b) One (ANS)
c) None
23) How do you register a user control?
a) Add Tag prefix, Tag name
b) Add Source, Tag prefix
c) Add Src, Tagprefix, Tagname (ANS)
24) Which of the following is true ?
a) User controls are displayed correctly in the Visual Studio .NET Designer
b) Custom controls are displayed correctly in VS.Net Designer (ANS)
c) User and Custom controls are displayed correctly in the Visual Studio .NET Designer
25) Can a dll run as stand alone application ?
a) No (ANS)
b) Yes
c) Sometimes we can make it by introducing some code
26) Which of the following is true ?
a) IsPostBack is a method of System.UI.Web.Page class
b) IsPostBack is a method of System.Web.UI.Page class
c) IsPostBack is a readonly property of System.Web.UI.Page class (ANS)
27) It is possible to set Maximum length for a text box through code
a) True (ANS)
b) False
28) The number of forms that can be added to a aspx page is
a) 2
b) 3
c) 1 (ANS)
d) More than 3

29) How do you manage states in asp.net application


a) Session Objects
b) application Objects
c) Viewstate
d) Cookies
e) All of the above (ANS)
30) The interface used by ASP.Net to create Unique Ids?
a) AppDomainsetup
b) System.UI.Naming.Container (ANS)
c) IAsyncResult
d) customFormatter
31) Which property of the session object is used to set the local identifier ?
a) SessionId
b) LCID (ANS)
c) Item
d) Key
32) Select the caching type supported by ASP.Net
a) Output Caching
b) DataCaching
c) Both a & b (ANS)
d) None of the above
33) Where is the default Session data is stored in ASP.Net
a) InProcess (ANS)
b) StateServer
c) SQL Server
d) All of the above
34) How do you disable client side validation ?
a) Set the language property to C#
b) Set the Runat property to server
c) Set the ClientTarget property to Downlevel (ANS)
d) Set the inherits property to codeb
35) Select the validation control used for PatternMatching
a) FieldValidator
b) RegularExpressionValidator (ANS)
c) RangeValidator
d) PatternValidator
36) How do you trace the application_End event on runtime?
a) By Debugging
b) By Tracing
c) Can not be done (ANS)

37) Who can access Session state variables


a) All Users of an application
b) A Single session (ANS)
c) All users within a single tunnel
38) Select the type Processing model that asp.net simulate
a) Event-driven (ANS)
b) Static
c) Linear
d) TopDown
39) Does the EnableViewState allows the page to save the users input on a form
a) Yes (ANS)
b) No
40) Web Controls Supports CSS
a) True (ANS)
b) False
41) Session Object classes are defined in which of the following namespace?
a) System.Web.UI
b) System.Web.SessionState
c) System.Web
42) Which DLL translate XML to SQL in IIS
a) SQLISAPI.dll (ANS)
b) SQLXML.dll
c) LISXML.dll
d) SQLIIS.dll
43) What is the default authentication mode for IIS
a) Windows
b) Anonymous (ANS)
c) Basic Authentication
d) None
44) Which of the following is not a valid state management tool?
a) Querystate (ANS)
b) Hidden Form Field
c) Application State
d) Cookies
45) What is the maximum number of cookies that can be allowed to a web site
a) 1
b) 10
c) 20
d) 30

e) More than 30

46) To add a custom control to a Web form we have to register with


a) TagPrefix
>
b) Name space of the dll that is referenced
c) Assemblyname
d) All of the above (ANS)
47) Custom Controls are derived from which of the classes
a) System.Web.UI.Customcontrols.Webcontrol
b) System.Web.UI.Customcontrol
c) System.Web.UI.Webcontrol (ANS)
48) A web application running on multiple servers is called as
a) Webfarm (ANS)
b) WebForm
c) Website
49) What is the transport protocol used to call a webservice
a) HTTP
b) SOAP (ANS)
c) TCP
d) SMTP
50) Whats the difference between Response.Write() andResponse.Output.Write()?
a) Response.Output.Write() allows you to flush output
b) Response.Output.Write() allows you to buffer output
c) Response.Output.Write() allows you to write formatted output (ANS)
d) Response.Output.Write() allows you to stream output
51) Why is Global.asax is used
a) Implement application and session level events (ANS)
b) Declare Global variables
c) No use
52) There can be more than 1 machine.config file in a system
a) True (ANS)
b) False
53) What is the extension of a web user control file ?
a) .Asmx
b) . Ascx (ANS)
c) .Aspx
54) What is the default session out time
a) 20 Sec
b) 20 Min (ANS)
c) 1 hr
55) The number of forms that can be added to a aspx page is
a) 2
b) 3

c) 1 (ANS)
d) More than 3
56) The interface used by ASP.Net to create Unique Ids?
a) AppDomainsetup
b) System.UI.Naming.Container (ANS)
c) IAsyncResult
d) customFormatter
57) Which property of the session object is used to set the local identifier ?
a) SessionId
b) LCID (ANS)
c) Item
d) Key
58) Select the caching type supported by ASP.Net
a) Output Caching
b) DataCaching
c) Both a & b (ANS)
d) None of the above
59) Where is the default Session data is stored in ASP.Net
a) InProcess (ANS)
b) StateServer
c) SQL Server
d) All of the above
60) How do you disable client side validation ?
a) Set the language property to C#
b) Set the Runat property to server
c) Set the ClientTarget property to Downlevel (ANS)
d) Set the inherits property to codeb
61) Select the validation control used for PatternMatching
a) FieldValidator
b) RegularExpressionValidator (ANS)
c) RangeValidator
d) PatternValidator
62) How do you trace the application_End event on runtime?
a) By Debugging
b) By Tracing
c) Can not be done (ANS)
63) Who can access Session state variables
a) All Users of an application
b) A Single session (ANS)
c) All users within a single tunnel

64) Select the type Processing model that asp.net simulate


a) Event-driven (ANS)
b) Static
c) Linear
d) TopDown
65) Does the EnableViewState allows the page to save the users input on a form
a) Yes (ANS)
b) No
66) Web Controls Supports CSS
a) True (ANS)
b) False
67. Which of the following will be the correct output for the C#.NET program given below?
namespace IndiabixConsoleApplication
{
class SampleProgram
{
static void Main(string[] args)
{
int num = 1;
funcv(num);
Console.Write(num + ", ");
funcr(ref num);
Console.Write(num + ", ");
}
static void funcv(int num)
{
num = num + 10; Console.Write(num + ", ");
}
static void funcr (ref int num)
{
num = num + 10; Console.Write(num + ", ");
}
}
}
A.
B.
C.
D.
E.

1, 1, 1, 1,
11, 1, 11, 11,
11, 11, 11, 11,
11, 11, 21, 11,
11, 11, 21, 21,

Answer: Option B

68. What will be the output of the C#.NET code snippet given below?
namespace IndiabixConsoleApplication
{
class SampleProgram
{
static void Main(string[] args)
{
int[]arr = newint[]{ 1, 2, 3, 4, 5 };
fun(ref arr);
}
static void fun(ref int[] a)
{
for (int i = 0; i < a.Length; i++)
{
a[i] = a[i] * 5;
Console.Write(a[ i ] + " ");
}
}
}
}
A.
B.
C.
D.
E.

12345
6 7 8 9 10
5 10 15 20 25
5 25 125 625 3125
6 12 18 24 30

Answer: Option C
69. Which of the following statements are correct?
An argument passed to a ref parameter need not be initialized first.
Variables passed as out arguments need to be initialized prior to being passed.
Argument that uses params keyword must be the last argument of variable argument list of a method.
Pass by reference eliminates the overhead of copying large data items.
To use a ref parameter only the calling method must explicitly use the ref keyword.
A.
B.
C.
D.
E.

1, 2
2, 3
3, 4
4, 5
None of these

Answer: Option C
70. A function returns a value, whereas a subroutine cannot return a value.
A.
True B.
False

Answer: Option A
71. Which of the following statements are correct about functions and subroutines used in C#.NET?
A function cannot be called from a subroutine.
The ref keyword causes arguments to be passed by reference.
While using ref keyword any changes made to the parameter in the method will be reflected in that variable when
control passes back to the calling method.
A subroutine cannot be called from a function.
Functions and subroutines can be called recursively.
A.
B.
C.
D.
E.

1, 2, 4
2, 3, 5
3, 5
4, 5
None of these

Answer: Option B

72.Which of the following statements is correct about the C#.NET code snippet given below?
class Student s1, s2; // Here 'Student' is a user-defined class.
s1 = new Student();
s2 = new Student();
A.
B.
C.
D.
E.

Contents of s1 and s2 will be exactly same.


The two objects will get created on the stack.
Contents of the two objects created will be exactly same.
The two objects will always be created in adjacent memory locations.
We should use delete() to delete the two objects from memory.

Answer: Option C
73. Which of the following statements is correct about the C#.NET code snippet given below?
class Sample
{
private int i;
public Single j;
private void DisplayData()
{
Console.WriteLine(i + " " + j);
}
public void ShowData()
{
Console.WriteLine(i + " " + j);
}

}
A.
B.
C.
D.
E.

j cannot be declared as public.


DisplayData() cannot be declared as private.
DisplayData() cannot access j.
ShowData() cannot access to i.
There is no error in this class.

Answer: Option E
74. Which of the following statements are correct?
Instance members of a class can be accessed only through an object of that class.
A class can contain only instance data and instance member function.
All objects created from a class will occupy equal number of bytes in memory.
A class can contain Friend functions.
A class is a blueprint or a template according to which objects are created.
A.
1, 3, 5
B.
2, 4
C.
3, 5
D.
2, 4, 5
E.
None of these
Answer: Option A
75. Which of the following statements is correct?
A.
Procedural Programming paradigm is different than structured programming paradigm.
B.
Object Oriented Programming paradigm stresses on dividing the logic into smaller parts and writing
procedures for each part.
C.
Classes and objects are corner stones of structured programming paradigm.
D.
Object Oriented Programming paradigm gives equal importance to data and the procedures that work on the
data.
E.
C#.NET is a structured programming language.
Answer: Option D
76.Which of the following is the correct way to create an object of the class Sample?
Sample s = new Sample();
Sample s;
Sample s; s = new Sample();
s = new Sample();
A.
1, 3
B.
2, 4
C.
1, 2, 3
D.
1, 4
E.
None of these
Answer: Option A

Question Here.
Answer:
1. C) i, ii and iv only
2. B) System.ValueType
3. D) All i, ii, iii and iv
4. D) All i, ii, iii and iv
5. A) i-d, ii-c, iii-a, iv-b
6. A) 25
7. B) Value Parameter
8. A)<Access Specifier><Return Type> <Method Name> (parameter list) {Method body}
9. D) All i, ii, iii
10. C) i-True, ii-True, iii-False
Question Here
Objective Questions in C#
1. In C# variables are categorized into ..........
i) Value types

ii) Reference types

iii) initial types

iv) pointer types

A) i, ii and iii only


B) ii, iii and iv only
C) i, ii and iv only
D) All i, ii, iii and iv
2. Value type variables can be assigned a value directly which are derived from the class
A) System.value
B) System.ValueType
C) General.ValueType
D) Variable.ValueType
3. The various data types used in C# are
i) Integral Type

ii) Floating point types

iii) Boolean types

iv) Nullable types

A) i, ii and iii only


B) ii, iii and iv only

C) i, iii and iv only


D) All i, ii, iii and iv
4. The built-in operators that are provided by C# programming language are...
i) Arithmetic operators

ii) Logical operators

iii) Bitwise operators

iv) Assignment operators

A) i, ii and iii only


B) ii, iii and iv only
C) i, iii and iv only
D) All i, ii, iii and iv
5. Match the different Bitwise operators supported by C# with their descriptions.
i) &

a) Binary Left Shift Operator

ii) ^

b) Binary Right Shift Operator

iii) <<

c) Binary XOR operator

iv) >>

d) Binary AND operator

A) i-d, ii-c, iii-a, iv-b


B) i-b, ii-c, iii-a, iv-d
C) i-c, ii-a, iii-b, iv-d
D) i-a, ii-c, iii-d, iv-b

6. What will be the value of the following expression if x=10?


A) 25
B) -5
C) 10
D) 15

7. While passing parameter to a method ................ copies the actual value of an argument into the formal parameter
of the function.
A) Output Parameter
B) Value Parameter
C) Reference Parameter
D) Initial Parameter
8. In C# methods can be defined by using which of the following syntex?
A) <Method Name> (parameter list) { Method body }
B) <Method Name> <Return Type> <Access Specifier> (parameter list) { Method body }
C) <Return Type> <Method Name> <Access Specifier> (parameter list) { Method body }
D) None of the above
9. Which of the following are the methods to assign values to an array?
i) double [ ] score = {234.0, 214.5, 572.0};
ii) int [ ] marks = new int [3] {33, 45, 67};
iii) int [ ] marks = new int [ ] {33, 45, 67};
A) i and ii only
B) ii and iii only
C) i and iii only
D) All i, ii, iii

10. State whether the following statements are True or False.


i) Unlike classes, structures cannot inherit other structures or classes.
ii) A structure can implement one or more interfaces.
iii) Structure members can be specified as abstract, virtual or protected.
A) i- True, ii- False, iii-True
B) i- False, ii- True, iii-True
C) i-True, ii-True, iii-False
D) i- False, ii- False, iii-True

Вам также может понравиться