- State True or False: If you set AutoGenerateColumns=True and still provide custom column definitions, the DataGrid will render both
- True
- False
- The data from an XSL Transform with XmlReader can be returned in one of the following ways
- objReader = objXslT.Transform(objNav, nothing)
- objXslT.Transform(objNav, nothing)
- objReader = objXslT.Transform(objNav, nothing, objWriter)
- objXslT.Transform(objNav, nothing, objWriter)
- Pick the command line that would result in the C# compiler generating an XML documentation file
- csc /doc:NewHome.xml NewHome.cs
- c /doc /docfile: NewHome.xml NewHome.cs
- csc /doc /out: NewHome.xml NewHome.cs
- csc /xml NewHome.cs
- csc /doc:NewHome.xml NewHome.cs
- What is the comment syntax for C#’s XML-based documentation?
- /** and **/
- //#
- ///
- //*
- When creating a C# Class Library project, what is the name of the supplementary file that Visual Studio.NET creates that contains General Information about the assembly?
- AssemblyInfo.xml
- AssemblyInfo.cs
- AssemblyInformation.cs
- AssemblyAttributes.cs
- AssemblyInfo.xml
- Which of the following is the C# escape character for Null?
- \n
- \0
- \f
- \v
- What is the exception that is thrown when there is an attempt to dynamically access a method that does not exist?
- MissingMethodException
- TypeLoadException
- MethodLoadException
- MethodAccessException
- What method(s) must be used with the Application object to ensure that only one process accesses a variable at a time?
- Synchronize()
- Lock() and UnLock()
- Lock()
- Asynchroize()
- After capturing the SelectedIndexChanged event for a ListBox control, you find that the event handler doesn’t execute. What could the problem be?
- The AutoEventWireup attribute is set to False
- The AutomaticPostBack attribute is set to False
- The codebehind module is not properly compiled
- The ListBox must be defined WithEvents
- What method must be overridden in a custom control?
- The Paint() method
- The Control_Build() method
- The Render() method
- The default constructor
- What is used to validate complex string patterns like an e-mail address?
- Extended expressions
- Regular expressions
- Irregular expressions
- Basic expressions
- The following is a valid statement in ASP.NET<%@ Page Language="C" %>
- True
- False
- A valid comment block in ASP.NET is
- <!- - - Comment - - - >
- <!- - Comment - - >
- <% - - Comment - - %>
- <% ! - - Comment - - >
- The event handlers that can be included in the Global.asax file are
- Application Start and
Session Start event handlers only - Application End and
Session End event handlers only - Per-request and Non-deterministic event handlers only
- Application Start and End ,
Session Start and End, Per-request and Non-deterministic event handlers
- Application Start and
- A Few of the Namespaces that get imported by default in an ASPX file are
- The Assemblies that can be referenced in an ASPX file without using @Assembly Directive is
- An .ASHX file contains the following
- What is the output for the following code snippet:
public class testClass { public static void Main(string[] args) { System.Console.WriteLine(args[1]); }//end Main }//end class testClass- Compiler Error
- Runtime Error
- Hello C# world
- None of the above
- One of the possible way of writing an ASP.NET handler that works like an ISAPI filter- that is, that sees requests and responses and modifies them also, is by,
- writing a module that extends FormsAuthenticatonModule and using it
- writing a component class that extends HttpModuleCollection and using it
- writing an HTTP module-a Class that implements IhttpModule and registering it in Web.Config
- All of the above
- The ASP.NET directive that lets you cache different versions of a page based on varying input parameters, HTTP headers and browser type is
- @OutputCache
- @CacheOutput
- @PageCache
- @CacheAll
- If we develop an application that must accommodate multiple security levels through secure login and ASP.NET web application is spanned across three web-servers (using round-robin load balancing) what would be the best approach to maintain login-in state for the users?
- <SessionState mode="InProc"stateConnectionString=" tcpip=127.0.0.1:42424" sqlConnectionString=" data source=127.0.0.1;user id=sa;password="cookieless="false" timeout="30" />
- <SessionState mode="OutProc" stateConnectionString="tcpip=127.0.0.1:42424" sqlConnectionString="data source=127.0.0.1;user id=sa;password=" cookieless="false" timeout="30" />
- <SessionState mode="stateserver" stateConnectionString="tcpip=127.0.0.1:42424" sqlConnectionString="data source=127.0.0.1;user id=sa;password=" cookieless="false" timeout="30" />
- What is the output for the below mentioned compilation command>csc /addmodule:A.Exe B.Cs
- A.exe
- B.exe
- A.dll
- B.dll
- How can be the web application get configured with the following authorization rules
- Anonymous users must not be allowed to access the application.
- All persons except David and John must be allowed to access the application.
- <authorization><deny users = "applicationname\David, applicationname\John" ><allow roles ="*"><deny roles = "?"></authorization>
- <authorization><allow users ="*"><deny users = "applicationname\David; applicationname\John" ><deny users = "*"></authorization>
- <authorization><deny users = "applicationname\David, applicationname\John" ><deny users = "?"><allow users ="*"></authorization>
- <authorization><allow users ="*"><deny users = "applicationname\David, applicationname\John" ></authorization>
- What will be the output of the following code snippet?
using System; class MainClass { static void Main( ) { new MainClass().Display( 3.56 ); } private void Display( float anArg ) { Console.Write( "{0} {1}", anArg.GetType(), anArg ); } double Display( double anArg ) { Console.Write( "{0} {1}", anArg.GetType(), anArg ); return anArg; } public decimal Display( decimal anArg ) { Console.Write( "{0} {1}", anArg.GetType(), anArg ); return anArg; } }
- What will be output for the given code?
Dim I as integer = 5 Do I = I + 2 Response.Write (I & " ") Loop Until I > 10
- 5 8
- 5 7 9
- 7 9 11
- Errors out

72 Comments on .NET WebDev interview questions - Part 3
25 What will be output for the given code?
Dim I as integer = 5
Do
I = I + 2
Response.Write (I & \” \”)
Loop Until I > 10
o 5 8
o 5 7 9
o 7 9 11
o Errors out
Answer:
7 9 11 (if corrected)
13.A valid comment block in ASP.NET is
Ans. C
1. what is the differece between c++ &java?
2.difference between .net & java
Ans 8.
To Make sure that ony single process use a variable at a time. We need to Synchronize the request to that variable.
The correct answer would be Synchronize()
HI,
Can somebody explain me the 50th answer .I quite did not get it.Please respond to this.
Thanks,
p
13. A valid comment block in ASP.NET is (a)
Hi,
Following is the explanation for the answer (#50) of the question # 24.
There are common suffixes for each literal type. Suffixes ensure that the literal is the intended type. This is good for documentation. However, the primary benefit is ensuring that your expressions are evaluated correctly; that is, the compiler will interpret float and decimal literals without suffixes as a double when evaluating an expression. To avoid the associated errors, use an appropriate literal suffix.
25 What will be output for the given code?
Dim I as integer = 5
Do
I = I + 2
Response.Write (I & \†\â€Â)
Loop Until I > 10
o 5 8
o 5 7 9
o 7 9 11
o Errors out
6.Which of the following is the C# escape character for Null?
• \n
•
• \f
• \v
Answer:
One of the possible way of writing an ASP.NET handler that works like an ISAPI filter-
that is, that sees requests and responses and modifies them also, is by,
writing a module that extends FormsAuthenticatonModule and using it
writing a component class that extends HttpModuleCollection and using it
writing an HTTP module-a Class that implements IhttpModule and registering it in Web.Config
All of the above
Ans : writing an HTTP module-a Class that implements IhttpModule and registering it in Web.Config
What is the output for the below mentioned compilation command>csc /addmodule:A.Exe B.Cs
A.exe
B.exe
A.dll
B.dll
Ans:B.dll
25. What will be output for the given code?
Dim I as integer = 5
Do
I = I + 2
Response.Write (I & \†\â€Â)
Loop Until I > 10
Ans.7 9 11
6. Which of the following is the C# escape character for Null?
* \n
*
* \f
* \v
Ans:
1.True
2.objXslT.Transform(objNav, nothing, objWriter)
3.csc /doc:NewHome.xml NewHome.cs
4.///
5.AssemblyInfo.cs(withen the properties folder)
6. go through(http://www.jaggersoft.com/csharp_standard/9.4.4.4.htm)
7.MissingMethodException
(there is no such exception like MethodLoadException)
8.Lock() and Unlock().
The HttpApplicationState class provides two methods, Lock and Unlock, that allow only one thread at a time to access application-state variables.
9.The AutomaticPostBack attribute is set to False
(The AutoEventWireup attribute by default true,also your event would not fired if you turn into false)
10.The Render() method must be overriden in the derived class.
11.Regular expressions
12.False
13.
14.Application Start and End ,
Session Start and End, Per-request and Non-deterministic event handlers
21.SessionState mode=â€Âstateserver†stateConnectionString=â€Âtcpip=127.0.0.1:42424″ sqlConnectionString=â€Âdata source=127.0.0.1;user id=sa;password=†cookieless=â€Âfalse†timeout=â€Â30″
(If ur appln spanned across two or more web-servers ,
then use stateserver mode)
6. Which of the following is the C# escape character for Null?
* \n
*
* \f
* \v
Ans:
State True or False:
If you set AutoGenerateColumns=True and still provide custom column definitions, the DataGrid will render both
True.
Grid will display all the columns and the custom columns.
Pick the command line that would result in the C# compiler generating an XML documentation file
csc /doc /out: NewHome.xml NewHome.cs
The following is a valid statement in ASP.NET
False
State True or False: If you set AutoGenerateColumns=True and still provide custom column definitions, the DataGrid will render both
True
False
Ans : False
The data from an XSL Transform with XmlReader can be returned in one of the following ways
objReader = objXslT.Transform(objNav, nothing)
objXslT.Transform(objNav, nothing)
objReader = objXslT.Transform(objNav, nothing, objWriter)
objXslT.Transform(objNav, nothing, objWriter)
Ans : objReader = objXslT.Transform(objNav,nothing)
Pick the command line that would result in the C# compiler generating an XML documentation file
csc /doc:NewHome.xml NewHome.cs
c /doc /docfile: NewHome.xml NewHome.cs
csc /doc /out: NewHome.xml NewHome.cs
csc /xml NewHome.cs
Answer A . csc /doc:NewHome.xml NewHome.cs
What is the comment syntax for C#’s XML-based documentation?
/** and **/
//#
///
//*
Answer : c ) ///
When creating a C# Class Library project, what is the name of the supplementary file that Visual Studio.NET creates that contains General Information about the assembly?
AssemblyInfo.xml
AssemblyInfo.cs
AssemblyInformation.cs
AssemblyAttributes.cs
Answer : B) AssemblyInfo.cs
Which of the following is the C# escape character for Null?
\n
\f
\v
Answer :
What is the exception that is thrown when there is an attempt to dynamically access a method that does not exist?
MissingMethodException
TypeLoadException
MethodLoadException
MethodAccessException
Answer : A)MissingMethodException
What method(s) must be used with the Application object to ensure that only one process accesses a variable at a time?
Synchronize()
Lock() and UnLock()
Lock()
Asynchroize()
c) Lock()
After capturing the SelectedIndexChanged event for a ListBox control, you find that the event handler doesn’t execute. What could the problem be?
The AutoEventWireup attribute is set to False
The AutomaticPostBack attribute is set to False
The codebehind module is not properly compiled
The ListBox must be defined WithEvents
b) The AutomaticPostBack attribute is set to False
What method must be overridden in a custom control?
The Paint() method
The Control_Build() method
The Render() method
The default constructor
c) The Render() method
What is used to validate complex string patterns like an e-mail address?
Extended expressions
Regular expressions
Irregular expressions
Basic expressions
b) Regular expressions
The following is a valid statement in ASP.NET
True
False
b) false
A valid comment block in ASP.NET is
b)
The event handlers that can be included in the Global.asax file are
Application Start and
Session Start event handlers only
Application End and
Session End event handlers only
Per-request and Non-deterministic event handlers only
Application Start and End ,
Session Start and End, Per-request and Non-deterministic event handlers
d) Application Start and End ,
Session Start and End, Per-request and Non-deterministic event handlers
A Few of the Namespaces that get imported by default in an ASPX file are
System, System.Data, System.Drawing,
System.Globalization
System,
System.IO, System.Management, System.Globalization
System, System.Collections,
System.Text, System.Web
System,
System.NET,
System.Reflection, System.Web
B) System, System.Collections,
System.Text, System.Web
The Assemblies that can be referenced in an ASPX file without using @Assembly Directive is
System.dll, System.Data.dll,
System.Web.dll, System.Xml.dll,
System.dll,
System.Collections.dll, System.IO.dll
System.dll, System.Reflection.dll,
System.Globalization.dll,
System.Drawing.dll, System.Assembly.dll,
System.Text.dll
Answer : A) System.dll, System.Data.dll,
System.Web.dll, System.Xml.dll,
An .ASHX file contains the following
Code-behind that are used in the code
Server Controls that can be called from a code-behind file
HTTP handlers-software modules that handle raw HTTP requests received by ASP.NET
Contains normal ASP.NET code and can be used as an include file
What is the output for the following code snippet:
public class testClass
{
public static void Main(string[] args)
{
System.Console.WriteLine(args[1]);
}//end Main
}//end class testClassCompiler Error
Runtime Error
Hello C# world
None of the above
Answer : A) Runtime Error
One of the possible way of writing an ASP.NET handler that works like an ISAPI filter- that is, that sees requests and responses and modifies them also, is by,
writing a module that extends FormsAuthenticatonModule and using it
writing a component class that extends HttpModuleCollection and using it
writing an HTTP module-a Class that implements IhttpModule and registering it in Web.Config
All of the above
c) implements IhttpModule and registering it in Web.Config
The ASP.NET directive that lets you cache different versions of a page based on varying input parameters, HTTP headers and browser type is
@OutputCache
@CacheOutput
@PageCache
@CacheAll
If we develop an application that must accommodate multiple security levels through secure login and ASP.NET web application is spanned across three web-servers (using round-robin load balancing) what would be the best approach to maintain login-in state for the users?
Answer:
c)
What is the output for the below mentioned compilation command>csc /addmodule:A.Exe B.Cs
A.exe
B.exe
A.dll
B.dll
B) B.exe
How can be the web application get configured with the following authorization rules
Anonymous users must not be allowed to access the application.
All persons except David and John must be allowed to access the application.
Answer : c. 10
5 8
5 7 9
7 9 11
Errors out
Answer : c . 7 9 11