|
.Net Web Interview Questions and Answers
What is used to validate complex string patterns like
an e-mail address?
* Extended expressions
* Regular expressions
* Irregular expressions
* Basic expressions
Regular Expression.
The following is a valid statement in ASP.NET<%@ Page
Language="C" %>
* True
* False
False
A valid comment block in ASP.NET is
* <!- - - Comment - - - >
* <!- - 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 ,
Application Start and End
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
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
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
HTTP handlers-software modules that handle raw HTTP
requests received by ASP.NET
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
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
writing an HTTP module-a Class that 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
@ OutputCache
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" />
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
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.
o <authorization><allow roles ="*"><deny roles =
"?"><</authorization>
o <authorization><deny users = "applicationname\David;
applicationname\John" ><deny users =
"*"></authorization>
o <authorization><deny users = "applicationname\David,
applicationname\John" ><deny users = "?"><allow users
="*"></authorization>
o <authorization><allow users ="*"><deny users = "applicationname\David,
applicationname\John" ></authorization>
authorization deny users = “applicationname\David,
applicationname\John” deny users = “?” allow users =”*”
/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;
}
}
* System.Single 3.56
* System.Float 3.56
* System.Double 3.56
* System.Decimal 3.56
System.Double 3.56
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
7 9 11 (if corrected)
Page Numbers :
1
2
3
4
5
Have a Question ?
post your questions here. It
will be answered as soon as possible.
Check
Microsoft .Net Interview
Questions for more Microsoft .Net Interview Questions with answers
Check
Asp .Net Interview
Questions for more Asp .Net Interview Questions with answers
Check
.Net Database Interview
Questions for more .Net Database Interview Questions with answers
Check
.Net
Deployment Interview
Questions for more .Net Deployment Interview Questions with answers
|