Monday, December 7, 2009

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 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

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 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