Thursday, May 28, 2009

JavaScript Events

Following are some of the events that are provided by JavaScript

OnChange:

Occurs when user changes values in an input control. In text controls this event fire after user changes focus to other controls

OnClick:

This event occurs when a user clicks on the button control.This event is also occurs when a form is submitted to server.

OnMouseOver:

This events occur when user moves the mouse pointer over a control.

OnMouseOut:

Occurs when the user move mouse pointer over a control.

OnKeyUp:

Occurs when user release a pressed key.

OnSelect:

Occurs when the User selects a portion of a text in a user control.

OnFocus:

Occurs when a control receive focus.

OnBlur:

Occurs when a focus leaves controls.

OnAbort:

Occurs when user cancels image download.

OnError:

Occurs when an image can’t be downloaded

Onload:

Occurs when a new page finishes downloading.

OnUnLoad:

Occurs when a page is unloaded(This typically occurs when a new url has been entered_

Share:

Authentication and authorization in asp.net

Authentication is the process that determines the identity of a user after a user has been authenticated, a developer can determine if the identified use has authorization to proceed.

Authorization is the process of determining whether an authenticated user is permitted access to other any part of application or access to specific data view that application provides.

There are three types of authentication method is provided by the asp.net users.

  1. Windows Authentication –Basic, Digest .
  2. Forms Authentication.
  3. Passport and integrated authentication.

Windows Authentication:

Windows authentication is used together with IIS authentication. When IIs Authentication is complete,ASP.NET uses the authenticated identity to authorize access. This is default settings.

Forms Authentication:

In forms authentication request that are no authenticated are redirect to an html form using HTTP client side redirection. The user provides his login information and submits the form. If application the request, the system issues a form that contains credentials or a key or a identity

Passport Authentication:

It is a centralized authentication service provided by Microsoft that offers single login and core profile services for member sites. This mode of authentication was de-emphasized by Microsoft at the end of 2004 year.

How to set authentication in web.config:

You can set the authentication mode in web.config as follows.

<Authentication Mode=”WindowsFormsPassportNone”></Authentication>

Share:
Wednesday, May 27, 2009

Increase Performance in asp.net application

For every enterprise level application the key to make that application success is the responsiveness of application. ASP.NET also offers great deal of the features for developing web based enterprise application but some times due to avoiding best practice to write application the performance of application performance of application is not so fast as it should be. Here are the some use full suggestion to make your application super fast.

  1. Always set debug=”false” in web.config production environment.
  2. Always set trace=”false” in web.config production environment
  3. If you are using asp.net 2.0 or higher version then always use precompiled version of your code and also prefer web application project over website. If you are using website then always publish it and then upload that precompiled version of your site in production environment.
  4. Always compile your project in Release Mode before uploading application to production environment.
  5. Decrease your html kb as much as you can for that use tables less html using div’s and if possible then do not give big name to your control it will increase your html kb as asp.net uses client Id to differentiate all the controls. If you are creating custom controls then you can overwrite your clientid and uniqueId.
  6. Use cache api as much as possible it will decrease your server roundtrip and boost application performance. ASP.NET 2.0 or higher version provides functionality called sqlcachedependancy for your database caching. It will validate cache with your database operation like insert,update and delete and if not possible with it then use the file base caching.
  7. Remove blank spaces from your html it will increase your kb. You can use regular expression to remove white spaces. I will post the code for removing white spaces next posts.
  8. For asp.net 2.0 and higher version use master pages. It will increase your performance.
  9. Prefer database reader over dataset unless and until you have specific reason to use database.
  10. Use ADO.NET asynchronous calls for ado.net methods. asp.net 2.0 or higher version is supporting your performance. If you are using same procedure or command multiple time then use ADO.NET Prepare command it will increase your performance.
  11. Do IIS performance tuning as per your requirement.
  12. Disable view state for your controls if possible. If you are using asp.net 2.0 or higher version then use asp.net control state instead of view state. Store view state in session or database by overriding the default methods for storing view state.
  13. User Server.Transfer instead of response.redirect.
  14. Always use inproc session state if possible.
  15. Use Ajax for your application wisely. Lots of Ajax calls for a page will also decrease your performance.
  16. Measure your application performance with tools like redgate profiler,firebug and whyslovw from yahoo.
  17. User System.Text.StringBuilder for string concatenation its 4 times more faster then the normal strings.
  18. Right JavaScript in .Js files and place it as bottom of the application.
  19. Use Separate CSS files for styling of application.
  20. User database paging over normal paging while displaying huge amount of data.
  21. Call web service from java script instead of server side. Use asynchronous calls to call a web method from web service.

That’s it!!…..Happy Programming..

Share:

Support this blog-Buy me a coffee

Buy me a coffeeBuy me a coffee
Search This Blog
Subscribe to my blog

  

My Mvp Profile
Follow us on facebook
Blog Archive
Total Pageviews