- 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 - - >
- 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>
71 Responses to “.NET WebDev interview questions - Part 3”
February 8th, 2006 at 1:30 am
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/p: It generates error because of \” \”. (VB.NET)
February 8th, 2006 at 2:06 am
18. 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
O/P:
Runtime Error
System.IndexOutOfRangeException.
February 8th, 2006 at 3:30 am
4. What is the comment syntax for C#’s XML-based documentation?
* /** and **/
* //#
* ///
* //*
Ans: ///
February 8th, 2006 at 3:38 am
3. Pick the command line that would result in the C# compiler generating an XML documentation file
A csc /doc:NewHome.xml NewHome.cs
B c /doc /docfile: NewHome.xml NewHome.cs
C csc /doc /out: NewHome.xml NewHome.cs
D csc /xml NewHome.cs
Ans: A
February 8th, 2006 at 3:45 am
6. Which of the following is the C# escape character for Null?
* \n
*
* \f
* \v
Ans:
February 8th, 2006 at 3:51 am
7. 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
Ans: MissingMethodException
February 8th, 2006 at 4:27 am
24. 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;
}
}
* System.Single 3.56
* System.Float 3.56
* System.Double 3.56
* System.Decimal 3.56
Ans: System.Double 3.56
February 8th, 2006 at 4:49 am
11. What is used to validate complex string patterns like an e-mail address?
* Extended expressions
* Regular expressions
* Irregular expressions
* Basic expressions
Ans: Regular Expression.
We can get more information from the following site.
http://support.microsoft.com/kb/308252
February 9th, 2006 at 5:44 am
10. # What method must be overridden in a custom control?
* The Paint() method
* The Control_Build() method
* The Render() method
* The default constructor
Ans: The Render() method
_________________________________
Love like you’ve never been hurt
Sasi. 09372423916
February 9th, 2006 at 10:16 am
9. 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
Ans: The AutoPostBack is set to False.
Try using the following code:
TheListBox.AutoPostBack = true;
TheListBox.ID = “ListBoxCheck”;
TheListBox.SelectedIndexChanged += new
EventHandler(TheListBox_SelectedIndexChanged);
___________________________________
Sasi
February 15th, 2006 at 11:59 am
6. Which of the following is the C# escape character for Null?
* \n
*
* \f
* \v
Ans:
February 15th, 2006 at 12:44 pm
Hi, I have installed .NET & trying to open C# with ASP.NET project. But it says “The webserver reported the following error when attempting to create or open the web project located at the following URL: ‘http://localhost/webapplication1. ‘The login request was denied’ “. Could someone please help me how to run ASP.NET projects in my system.
February 16th, 2006 at 1:48 am
14. The event handlers that can be included in the Global.asax file are
1 Application Start and
Session Start event handlers only
2 Application End and
Session End event handlers only
3 Per-request and Non-deterministic event handlers only
4 Application Start and End ,
Session Start and End, Per-request and Non-deterministic event handlers
Ans: 4
—————————-
The Events in Global.asax file are
Application_Start
Application_Init
Application_Disposed
Application_Error
Application_End
Application_BeginRequest
Application_EndRequest
Application_PreRequestHandlerExecute
Application_PostRequestHandlerExecute
Application_PreSendRequestHeaders
Application_PreSendRequestContent
Application_AcquireRequestState
Application_ReleaseRequestState
Application_AuthenticateRequest
Application_AuthorizeRequest
Session_Start
Session_End
_______
Sasi. ;-)
——-
February 18th, 2006 at 1:55 am
1.
False.
It will only show Auto generated columns.
If the custom defined columns are called on pageload, it shows them but on the occuring of an event which generates columns automatically, the previous rendering will be replaced by auto generated columns.
February 23rd, 2006 at 1:39 pm
Q 15 Ans c
Q 16 Ans A
February 23rd, 2006 at 1:44 pm
20 A
23
13
12 false c not supported
February 23rd, 2006 at 3:14 pm
1. Answer is True(Checked with MSDN) It will render both Custom columns and autogenerated columns. Custom columns will be rendered first before others columns are rendered .
March 2nd, 2006 at 10:09 am
For the first question, autogenerate and custom defined columns , its rendering both. In my case autogenerate is true and i have defined a databound column, so i am getting that custom defined column as well as autogenerated columns, then the answer for the first question should be true, if not can somebody explain me how come this is false.
March 9th, 2006 at 8:26 am
23)
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.
ans:c
March 10th, 2006 at 7:07 pm
Ans 6 : ” for null
March 10th, 2006 at 7:09 pm
Ans 2 : b)objXslT.Transform(objNav, nothing)
March 10th, 2006 at 7:14 pm
MissingMethod Excception
March 10th, 2006 at 7:28 pm
Ans 8 Lock() so that multiple user can not acces your application
March 10th, 2006 at 7:33 pm
Ans 9 The Because AutoPostBack attribute is set to False
March 16th, 2006 at 3:37 pm
1. State True or False: If you set AutoGenerateColumns=True and still provide custom column definitions, the DataGrid will render both
*True
*False
Answer:
Custom declared columns may be used in conjunction with auto-generated columns. When using both, custom declared columns will be rendered first, followed by the auto-generated columns.
March 16th, 2006 at 5:21 pm
2. The data from an XSL Transform with XmlReader can be returned in one of the following ways
o objReader = objXslT.Transform(objNav, nothing)
o objXslT.Transform(objNav, nothing)
o objReader = objXslT.Transform(objNav, nothing, objWriter)
o objXslT.Transform(objNav, nothing, objWriter)
Answer:
objReader = objXslT.Transform(objNav, nothing)
March 17th, 2006 at 12:37 am
3. Pick the command line that would result in the C# compiler generating an XML documentation file
o csc /doc:NewHome.xml NewHome.cs
o c /doc /docfile: NewHome.xml NewHome.cs
o csc /doc /out: NewHome.xml NewHome.cs
o csc /xml NewHome.cs
Answer:
csc /doc:NewHome.xml NewHome.cs
March 17th, 2006 at 10:56 am
4 What is the comment syntax for C#’s XML-based documentation?
o /** and **/
o //#
o ///
o //*
Answer: ///
March 17th, 2006 at 11:44 am
5. 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?
o AssemblyInfo.xml
o AssemblyInfo.cs
o AssemblyInformation.cs
o AssemblyAttributes.cs
Answer: AssemblyInfo.cs
March 17th, 2006 at 12:30 pm
6.Which of the following is the C# escape character for Null?
• \n
•
• \f
• \v
Answer:
March 17th, 2006 at 12:37 pm
7. What is the exception that is thrown when there is an attempt to dynamically access a method that does not exist?
o MissingMethodException
o TypeLoadException
o MethodLoadException
o MethodAccessException
Answer: MissingMethodException
March 17th, 2006 at 12:56 pm
8. What method(s) must be used with the Application object to ensure that only one process accesses a variable at a time?
o Synchronize()
o Lock() and UnLock()
o Lock()
o Asynchroize()
Answer: Lock()
March 18th, 2006 at 1:05 am
9. After capturing the SelectedIndexChanged event for a ListBox control, you find that the event handler doesn’t execute. What could the problem be?
o The AutoEventWireup attribute is set to False
o The AutomaticPostBack attribute is set to False
o The codebehind module is not properly compiled
o The ListBox must be defined WithEvents
Answer:
AutoPostBack attribute is set to False
March 18th, 2006 at 1:11 am
10. What method must be overridden in a custom control?
o The Paint() method
o The Control_Build() method
o The Render() method
o The default constructor
Answer: The Render() method
March 18th, 2006 at 1:15 am
11. What is used to validate complex string patterns like an e-mail address?
o Extended expressions
o Regular expressions
o Irregular expressions
o Basic expressions
Answer: Regular expressions
March 18th, 2006 at 1:20 am
12. The following is a valid statement in ASP.NET
o True
o False
Answer: False
March 18th, 2006 at 1:27 am
13. A valid comment block in ASP.NET is
a.
b.
c.
d.
Answer:
March 18th, 2006 at 9:58 am
The event handlers that can be included in the Global.asax file are
o Application Start and
Session Start event handlers only
o Application End and
Session End event handlers only
o Per-request and Non-deterministic event handlers only
o Application Start and End ,
Session Start and End, Per-request and Non-deterministic event handlers
Answer: Application Start and End ,
Session Start and End, Per-request and Non-deterministic event handlers
March 18th, 2006 at 11:07 am
15. A Few of the Namespaces that get imported by default in an ASPX file are
o System, System.Data, System.Drawing,
System.Globalization
o System,
System.IO, System.Management, System.Globalization
o System, System.Collections,
System.Text, System.Web
o System,
System.NET,
System.Reflection, System.Web
Answer:
System, System.Collections,
System.Text, System.Web
March 19th, 2006 at 2:53 am
16. The Assemblies that can be referenced in an ASPX file without using @Assembly Directive is
o System.dll, System.Data.dll,
System.Web.dll, System.Xml.dll,
o System.dll,
System.Collections.dll, System.IO.dll
o System.dll, System.Reflection.dll,
System.Globalization.dll,
o System.Drawing.dll, System.Assembly.dll,
System.Text.dll
Answer:
System.dll, System.Data.dll,
System.Web.dll, System.Xml.dll
March 19th, 2006 at 8:47 pm
17 An .ASHX file contains the following
o Code-behind that are used in the code
o Server Controls that can be called from a code-behind file
o HTTP handlers-software modules that handle raw HTTP requests received by ASP.NET
o Contains normal ASP.NET code and can be used as an include file
Answer: HTTP handlers-software modules that handle raw HTTP requests received by ASP.NET
March 19th, 2006 at 8:49 pm
13. A valid comment block in ASP.NET is
“”
“”
“”
“”
Answer: “”
March 20th, 2006 at 12:47 am
18 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
Answer: Runtime Error
March 20th, 2006 at 1:02 am
19 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
Answer:
writing an HTTP module-a Class that implements IhttpModule and registering it in Web.Config
March 20th, 2006 at 1:26 am
20.The ASP.NET directive that lets you cache different versions of a page based on varying input parameters, HTTP headers and browser type is
o @OutputCache
o @CacheOutput
o @PageCache
o @CacheAll
Answer:
@ OutputCache
March 20th, 2006 at 1:13 pm
21 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?
o
o
o
Answer:
March 20th, 2006 at 1:14 pm
21 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?
o 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″
o 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″
o 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″
Answer:
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″
March 20th, 2006 at 10:33 pm
22 What is the output for the below mentioned compilation command>csc /addmodule:A.Exe B.Cs
o A.exe
o B.exe
o A.dll
o B.dll
Answer: B.exe
March 20th, 2006 at 10:38 pm
23 How can be the web application get configured with the following authorization rules
o Anonymous users must not be allowed to access the application.
o All persons except David and John must be allowed to access the application.
Answer:
authorization
deny users = “applicationname\David, applicationname\John”
deny users = “?”
allow users =”*”
/authorization
March 20th, 2006 at 10:45 pm
24 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;
}
}
o System.Single 3.56
o System.Float 3.56
o System.Double 3.56
o System.Decimal 3.56
Answer:
System.Double 3.56
March 20th, 2006 at 10:59 pm
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)
May 7th, 2006 at 5:41 am
13.A valid comment block in ASP.NET is
Ans. C
May 11th, 2006 at 11:32 pm
1. what is the differece between c++ &java?
2.difference between .net & java
July 15th, 2006 at 5:52 am
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()
October 7th, 2006 at 10:19 pm
HI,
Can somebody explain me the 50th answer .I quite did not get it.Please respond to this.
Thanks,
p
October 9th, 2006 at 8:26 am
13. A valid comment block in ASP.NET is (a)
November 9th, 2006 at 12:02 pm
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.
December 13th, 2006 at 6:09 am
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
December 27th, 2006 at 12:20 am
6.Which of the following is the C# escape character for Null?
• \n
•
• \f
• \v
Answer:
March 10th, 2007 at 1:42 am
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
March 10th, 2007 at 1:43 am
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
May 3rd, 2007 at 5:49 pm
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
July 21st, 2007 at 10:19 pm
6. Which of the following is the C# escape character for Null?
* \n
*
* \f
* \v
Ans:
August 23rd, 2007 at 4:24 am
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)
August 23rd, 2007 at 5:01 am
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.
August 23rd, 2007 at 6:51 am
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
August 24th, 2007 at 1:57 am
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)
October 16th, 2007 at 10:45 am
6. Which of the following is the C# escape character for Null?
* \n
*
* \f
* \v
Ans:
November 29th, 2007 at 5:53 am
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.
November 29th, 2007 at 5:55 am
Pick the command line that would result in the C# compiler generating an XML documentation file
csc /doc /out: NewHome.xml NewHome.cs
November 29th, 2007 at 6:05 am
The following is a valid statement in ASP.NET
False