what is the use of Application.Exit() method?

Tuesday, December 29, 2009


Notifies all message loops to quit, closes windows opened by them and closes program.


www.codecollege.NET

what is the use of the Environment.Exit() method?


Terminates the program and gives the return value to os as exit code.


www.codecollege.NET

Daily Tips- Tip #45 - How to exit c# applications?


You can exit using the following 2 static methods,
1. Environment.Exit(returnval)
2. Application.Exit()


www.codecollege.NET

Daily Tips- Tip #44 - What is the use of checked keyword in c# ?


it is used to apply range checking to an operation.


www.codecollege.NET

What are the other UI related enhancements in asp.net 4.0?

Saturday, December 19, 2009


1. Better support to Web standards and Accessibility.
2. Better attribute values(boolean) for controls with Disabled attribute.
3. In-line css support for validation controls.
4. CSS for the Hidden Fields Div Element.
5. CSS and UI related to many other controls


www.codecollege.NET

What is the name of the new control added to asp.net 4.0 for filtering data?


QueryExtender Control.


www.codecollege.NET

What is the use of RenderOuterTable property in FormView control of asp.net 4.0 ?


It makes the CSS styling in the FormView control easier.


www.codecollege.NET

What is the PersistedSelection in a gridview newly introduced in asp.net 4.0?


It is a new attribute which makes the selected row in a gridview persistable between navigation between pages in a gridview.


www.codecollege.NET

What are the 3 algorithms used to generate clientIds in asp.net 4.0?


1. AutoID.algorithm
2. Static algorithm
3. Predictable algorithm


www.codecollege.NET

What is the use of new ClientIDMode property in asp.net 4.0?


It makes client-side script accessing asp.net server controls rendered as html controls.


www.codecollege.NET

How will you set the Incredible Shrinking Session State in asp.net 4.0?


Using the compressionEnabled config entry.


www.codecollege.NET

What is Incredible Shrinking Session State in asp.net 4.0?


It a feature which compresses session states in StateServer and SQL Server modes of session storage.


www.codecollege.NET

What is the use of RedirectPermanent?


It solves the permanently moved related issues.


www.codecollege.NET

Apart from Response.Redirect and Server.Transfer what is new in asp.net 4.0?


RedirectPermanent.


www.codecollege.NET

In what way is output-caching extensible?


It allows to cofigure custom output-cache providers.


www.codecollege.NET

What new enhancement was done to output cahcing in asp.net 4.0?


Output cahcing was made as extensible.


www.codecollege.NET

Using which attribute will you make the transformation in the web.config file of asp.net 4.0?


xdt:Transform="Replace"


www.codecollege.NET

What is the expansion of XDT?


XML Document Transform (XDT),is the feature that lets you transform a Web.config file.


www.codecollege.NET

How visual studio 2010 implements Web.Config Transformation?


using XDT.


www.codecollege.NET

What is Web.Config Transformation in visual studio 2010?


It transforms web.config from development environment to production environment.


www.codecollege.NET

What is called as a Web package in asp.net 4.0?


The compressed file created for your application using MSDeploy tool.


www.codecollege.NET

Which tool is used by visual studio 2010 to create zipped files?


MSDeploy tool .


www.codecollege.NET

What enhancement was done to Dynamic Data in asp.net 4.0 ?


Feature to build quick dynamic data websites.


www.codecollege.NET

Does asp.net 4.0 supports Dynamic Data ?


Yes.


www.codecollege.NET

How will you set the Backward Compatibility feature in asp.net 4.0?


You need make the following change to the web.config ,
<system.web>
<pages controlRenderingCompatibilityVersion="3.0"/>
</system.web>


www.codecollege.NET

What is the new feature introduced in redering in asp.net 4.0?


The new feature is to have Backward Compatibility in Control Rendering.


www.codecollege.NET

What is the class that you use when you define Routes?


The PageRouteHandler class .


www.codecollege.NET

What is the advantage of Routing?


It makes your site more user-friendly and your site content more discoverable by search engines.


www.codecollege.NET

Does ASP.NET 4.0 adds built-in support for routing with Web Forms?


Yes.


www.codecollege.NET

Explain What is browser capabilities providers?


It lets you build a provider that in turn lets you write custom code to determine browser capabilities.


www.codecollege.NET

What is the New Way to Define Browser Capabilities in asp.net 4.0?


It is browser capabilities providers.


www.codecollege.NET

Where is the browser capabilities object stored in asp.net?


HttpRequest.Browser property


www.codecollege.NET

How will you detect a browser's capabilities in asp.net?


using HttpBrowserCapabilities object .


www.codecollege.NET

How will you set the meta tag description for a page in asp.net 4.0?


using Page.MetaDescription


www.codecollege.NET

How will you set the meta keywords for a page in asp.net 4.0?


using Page.MetaKeywords.


www.codecollege.NET

What are the 2 properties added to the Page class for meta tags in asp.net 4.0?


1. Page.MetaKeywords
2. Page.MetaDescription


www.codecollege.NET

How will you make an application auto-startable in asp.net 4.0?


To use the auto-start feature, an IIS administrator sets an application pool in IIS 7.5 to be automatically started by using the following configuration in the

applicationHost.config file:






www.codecollege.NET

What is auto-start feature in asp.net 4.0?

Thursday, December 17, 2009


It is an feature which can be automatically started by using the configuration in the applicationHost.config file.


www.codecollege.NET

Explain Windows HTTP Services Certificate Configuration Tool (WinHttpCertCfg.exe)?


The Microsoft Windows HTTP Services (WinHTTP) Certificate Configuration Tool, WinHttpCertCfg.exe, enables administrators to install and configure client certificates in any
certificate store that can be accessed by the Internet Server Web Application Manager (IWAM) account.


www.codecollege.NET

What is the tool which is used to configure Windows HTTP Services Certificate ?


WinHttpCertCfg.exe


www.codecollege.NET

Daily Tips- Tip #43 - What is the shortcut key to bring up the Immediate window?

Wednesday, December 16, 2009


Ctrl + Alt + I.


www.codecollege.NET

What is an HttpCombiner?


An HTTP handler that combines multiple CSS, Javascript or URL into one response for faster page load. It can combine, compress and cache response which results in faster page
load and better scalability of web application.


www.codecollege.NET

Daily Tips- Tip #42 -How will you test memory leak in a .NET application?


using Perfmon.exe application.


www.codecollege.NET

What is the css equivalent for the NOBR tag?


the space character  


www.codecollege.NET

What is the best practice for calling explicit garbage collections?

Monday, December 14, 2009


You should call the finalizer after gc like,

//c#
GC.Collect();
GC.WaitForPendingFinalizers();


www.codecollege.NET

Which one is a best practice to use DirectCast or CType?


DirectCast


www.codecollege.NET

Which is the best practice in applying multiple attributes to a same member?


Instead of applying it as comma seperated, apply individually in separate lines,
//c#
[Conditional("TRACE")]
[DebuggerStepThrough]
void MyMethod()
{
}


www.codecollege.NET

Daily Tips- Tip #41 - How will you mark a method as obsolete?


//c#
[Obsolete("Call NewMethod instead")]
void OldMethod()
{

}


www.codecollege.NET

Daily Tips- Tip #40 - How will you mark a method as Non-CLSCompliant?


//c#
[CLSCompliant(false)]
public void MyMethod(0
{
}


www.codecollege.NET

Daily Tips- Tip #39 - How will you mark an assembly with CLSComplaint?


'VB


//C#
[assembly: CLSCompliant(true)>


www.codecollege.NET

Daily Tips- Tip #38 -What is the short-cut for uncommenting code ?


Ctrl + K, Ctrl + U


www.codecollege.NET

Daily Tips- Tip #37 -What is the Short-cut for commenting out the code?


Ctrl + K, Ctrl + C


www.codecollege.NET

What is the expansion of CAO?

Sunday, December 13, 2009


Client-Activated Objects.


www.codecollege.NET

Daily Tips- Tip #36 - How will you beging a running a standard application message loop on the current thread?

Friday, December 11, 2009


Application.Run(new Form1());


www.codecollege.NET

Daily Tips- Tip #35 - What is the method in MS Exception Management Application Block which is used to publish exceptions?


ExceptionManager.Publish(ex);


www.codecollege.NET

Is it true that objects don't always get destroyed immediately when the last reference goes away?


Yes. The garbage collector offers no guarantees about the time when an object will be destroyed and its memory reclaimed.


www.codecollege.NET

Daily Tips- Tip #34 - What is the best way to check for a null and an empty value in a string?


string mystr;
if (String.IsNullOrEmpty(mystr))


www.codecollege.NET

Daily Tips- Tip #33 - How to view trace details for a specific request?

Thursday, December 10, 2009


To view trace details for a specific request
1.Goto to Trace.axd in the root of your application.

For ex: if the URL for your application is http://localhost/myApplication, Goto http://localhost/myApplication/trace.axd to view the trace information for that application.

2.Select the View Details link for the specific request that you want to investigate.



www.codecollege.NET

How to enable application level Tracing?


<configuration>
<system.web>
<trace enabled="true" pageOutput="false" requestLimit="40" localOnly="false"/>
</system.web>
</configuration>


www.codecollege.NET

Which class has culture information used for resource files?

Monday, December 7, 2009


Thread.CurrentThread.CurrentUICulture


www.codecollege.NET

Which class do we need to assign formatting related culture information?


Thread.CurrentThread.CurrentCulture


www.codecollege.NET

How will you create a specific culture?


CultureInfo.CreateSpecificCulture()


www.codecollege.NET

Daily Tips- Tip #32 - #region blocks


Enclose Methods and Interfaces in #region blocks so that it can be collapsed or expanded.


www.codecollege.NET

How will you refine filter condition in Catch blocks and avoid rethrowing an exception?


use When keyword


www.codecollege.NET

Which is the best practice for explicit event subscriptions: using AddHandler and RemoveHandler or WithEvents?


using AddHandler and RemoveHandler


www.codecollege.NET

How will you unsubscribe an event?


You can unsubscribe an event using the RemoveHandler


www.codecollege.NET

Daily Tips- Tip #31 - How will you invoke Immediate window in Visual studio?


1. Open the command window in Visual Studio
2. Type “immed” To Execute statements


www.codecollege.NET

Which is the best practice for a string constant with backslash or which spans multiple line?


Verbatim(@) strings imporves code readability.


www.codecollege.NET

Which one is faster ChrW or Chr ?


ChrW


www.codecollege.NET

How will you protect your ASP.NET application from XSS?


You can prevent your website from xss using:
1. Validate Input received from your site.
2. Encode Output generated from your site.


www.codecollege.NET

How will you encode URL strings?


HttpUtility.UrlEncode


www.codecollege.NET

What is XSS?


Cross-site scripting .


www.codecollege.NET

Where will you handle application level Exceptions?


In the application_error event in the global.asax.


www.codecollege.NET

How will you lock configuration settings?


use the path attribute on the element to identify the Web application.


www.codecollege.NET

What interface do you need to implement for your HttpHandler to support sessions?


It needs to implement IRequiresSessionState or IReadOnlySessionState in order to use session state.


www.codecollege.NET

How will you find which control did the postback?


you can find the control which did postback using "__EVENTTARGET" with few exceptions.


www.codecollege.NET

How will you impersonate the original caller?


<authentication mode="Windows" />
<identity impersonate="true" />


www.codecollege.NET

When do you use windows authentication in ASP.NET 2.0?


Your ASP.NET application should use windows authentication when your users have windows accounts that can be authenticated by a server. The accounts can be local windows accounts or domain accounts.


www.codecollege.NET

How will you enforce strong passwords using membership feature in ASP.NET 2.0?


You can enforce strong passwords using membership by configuring the attributes minRequiredPasswordLength, minRequiredNonAlphanumericCharacters, and passwordStrengthRegularExpression on your membership provider configuration.


www.codecollege.NET

Where will you place your user-interface strings ?

Saturday, December 5, 2009


It is a best practice to place all your user-interface strings in a resource file rather burning them in code.


www.codecollege.NET

How to read a Session variable in javascript?

Friday, December 4, 2009


var jsUsername;
jsUsername = <%=Session["CurrentUser"]%>


www.codecollege.NET

Which control of Ajax control toolkit populates matching list upon entering characters in a text box?

Wednesday, December 2, 2009


AutoCompleteExtender.


www.codecollege.NET

What is SAML?


Security Assertion Markup Language.


www.codecollege.NET

How will declare a one way communication method in a ASP.NET Webservice?


[SoapDocumentMethod(OneWay=true)]
[WebMethod()]
public void AOneWayComm()
{
//
}


www.codecollege.NET

Visual Studio 2010 Beta 2


you can download Visual Studio 2010 Beta 2 from the following location,




www.codecollege.NET

LinkWithin

Blog Widget by LinkWithin

Recommended Books