Showing posts with label Advance. Show all posts
Showing posts with label Advance. Show all posts

Different Server Side Tags

There are multiple types of server tags and most of the time I wonder what does they mean and in which situation what tag should I use. I Search out the internet and found something which I like to share.

There are six types of the server side tags:-
  1. <% %> This is an inline server side code block which is executed during Render. Generally we call methods inside our page code behind file through this. For Details see this.
  2. <%= %> This is the replacement for Response.Write to a specific place. Most of the time we use it to display single pieces of information. For Details see this.
  3. <%# %> We use during the data binding. For Details see this.
  4. <%$ %> This is used for ASP.NET Expression. Generally I use it to extract resources from resource files. For Details see this.
  5. <%@ %> This is use for Directive Syntax. For Details see this.
  6. <%-- --%> Server-Side Comments generally we use this to comment server side controls. For Details see this.

How to send periodic/timely Emails

I was busy during last few months and can not spare time for my blog. However during my project i came up with a situation that I have to send emails on daily basis through system. I would like to share the different approaches which I found during my goggling.

I came across three options to accomplish this:-

1- Create a simple .exe file which sends the mails and add it in windows scheduled tasks.
How To Schedule Task in Windows XP

2- Create a Window Service, which sleeps for 24 hours after sending emails.
Simple Windows Service Sample

3- Create a JOB in Sql Server. For details see:
Automated Email Notifications using SQL Server Job Scheduler

How to Optimize Web Site Performance


  1. White Space Filtering through HTTP Module.
  2. Merge all inline styles and multiple CSS into one big global css file.
  3. Merge all inline javascripts and multiple javascript files into one big .js file and add reference to this file whenever you require.
  4. Minify JavaScript and CSS files using CSS Optimizer and Free JavaScript Optimizer or any other tool which you like.
  5. Try using less images in your web page.
  6. Optimize your images with image optimizer I use Trout's GIF Optimizer to optimize gif files. PngOptimzer to optimize my PNG files, both the optimizer does not effect the quality of your image.
  7. If your pagesize is increasing because of ViewState then try to save viewstate on server side. Here is a simpe example to Save ViewState on the File System
These six steps really helps your site in loosing the weight and they do not take much effort at all. After implementing these six steps see the performance of your application. If after that you are not satisfied enough then try following links:-
10 ASP.NET Performance and Scalability Secrets
Performance Optimization of ASP.NET Applications on Client-side

Also take a look at 15 Tools to Help You Develop Faster Web Pages.