Thursday, April 27, 2006
ASP.NET 2.0 Magic: Asynchronous Web Pages
We can set an asp.net page to execute asynchronously by setting up the Async tag in the Page declaration of the ASP.NET Page.
<%@ Page Async="true" ... %>
This reference on the MSDN will be helpful in understanding it in details.
http://msdn.microsoft.com/msdnmag/issues/05/10/WickedCode/
Monday, March 06, 2006
Speed Up your web sites with HTTP Compression
1. Increase the speed of web page retrieval (effectively the speed of your web site).
2. Reduce the bandwidth utilization.
How to achieve all these??
You can achieve the above goal by decreasing the size of your HTML pages, JS, CSS which can be done be a technique known as HTTP Compression.
Idea behind HTTP Compression:
The idea is to compress data being sent out from your Web server, and have the browser decompress this data on the fly, thus reducing the amount of data sent and increasing the page display speed. There are two ways to compress data coming from a Web server, dynamically, and pre-compressed. Dynamic Content Acceleration compresses the data transmission data on the fly (useful for e-commerce apps, database-driven sites, etc.). Pre-compressed text based data is generated beforehand and stored on the server (.html.gz Files etc). [source:]
The compression techniques (algorithm) used can be
1. GZIP
2. Deflate Compression
I found a very useful link with details of the software used for HTTP compression
http://www.websiteoptimization.com/speed/18/
Thursday, February 02, 2006
Home automation in the Netherlands
read more | digg story
Friday, January 27, 2006
Some Useful Web Links
One of my colleague accumulated a list of useful links on the web , i have uploaded that document on the Writely . It you want to collaborate on this document to add more useful links, please send me your email address so that i can add you in the collaborator list.
Its URL is:
http://www.writely.com/Doc.aspx?id=bcsw8fz74pf
Hope it will be useful for you you guys.
Acknowledgments:
Adeel Anwar
Wednesday, January 25, 2006
Wednesday, January 18, 2006
Posting data to another ASPX Page
One of the common problems faced by the JSP and ASP developers while developing application in ASP.NET is posting data to another ASPX page. By Default if you have a server side form tag in an aspx page then it will post the data to the same page.
I Came across a very easy to understand article for doing this, hope it will also help you in understanding the concept.
Monday, December 19, 2005
How to use Microsoft Indexing Service?
Want to add document search in your application, you can use microsoft indexing service to do that. You can create a Catlog in the Microsoft indexing service on the folder whose document you want to search from your application. I will guide you on how to use microsoft indexing service from your ASP.NET page.
Go to Computer Management->Services and Application->Indexing Service and make sure that it is running.



MS Indexing Service + ASP.NET
Creating an ASP.NET page that can query from the MS Indexing service, I will use the 'Web' catalog that is created by deafult by the indesing service on the 'c:\inetpub\wwwroot\' folder.
We can connect to the MS Indexing service through the following Connection String {"Provider=\"MSIDXS.1\";Data Source=
You can select the Name of the File, the path where it is located and some of the text from the file. {Select FileName,Path,Characterization from Scope()}
Code:
protected System.Data.OleDb.OleDbConnection oleDbConnection1;
this.oleDbConnection1.ConnectionString = "Provider=\"MSIDXS.1\";Data Source=Web;Integrated Security .=";
{You can change the 'Data Source' to the name of the catalog in which you want to search}
protected System.Data.OleDb.OleDbCommand oleDbSelectCommand3;
protected System.Data.OleDb.OleDbDataAdapter oleDbDataAdapter2;
this.oleDbSelectCommand3 = new System.Data.OleDb.OleDbCommand();
this.oleDbDataAdapter2 = new System.Data.OleDb.OleDbDataAdapter();
Sample Project:
Sample ASP.NET Project
Friday, December 16, 2005
What is .Resx file in Dot Net?
It is an XML based file, with key value pair.
Reading from .Resx File:
You can access the .Resx file using this code:
ResXResourceReader reader = new ResXResourceReader(Server.MapPath("test.resx"));
IDictionaryEnumerator rsxr = reader.GetEnumerator();
foreach (DictionaryEntry d in reader)
{
Console.WriteLine(d.Key.ToString() + ":\t" + d.Value.ToString());
}
//Close the reader.
reader.Close();
Writing to .Resx File:
We can write the binary data of an image to the .Resx file using the following code
Image img = Image.FromFile("urdu.jpg");
ResXResourceWriter rsxw = new ResXResourceWriter("urdu.resx");
rsxw.AddResource("urdu.jpg",img);
rsxw.Close();
Use of .Resx File:
It is very useful while working on Localized project [Multiple Languages], You can make different resource files for different languages and depending upon the user choice you can change the Language of the application.
Tuesday, November 29, 2005
AJAX : Todays Buzzword
What AJAX is all about??
Want to get the bigger picture, I hope these slide will help you a lot, If not then do write to me for any assistence.
http://www.geocities.com/basit_tanveer/Data/AJAX.ppt
Wednesday, October 19, 2005
Executable Jar File in JAVA.
jar -cfm [name of the jar file] [name of the manifest]
Flags Description:
c: Create new archive
f: Specify the archive name
m: include manifest
* means include all the files in the current folder and all the sub folders.
The manifest file look something like this:
Main-Class: [name of the main class along with the package details]
Example
If your project has two files a.class and main.class. which are placed in a package(abc.def). Then the manifest would look like this(mainClass.mf):
___________________
Main-Class: abc.def.main
___________________
and the command to create an executable jar will be
jar -cfm test.jar mainClass.mf *
Everything works ok if you are not using any external jars but the problem arises when you have externals jar like you have used the logging component log4j. The manifest attribute Class-Path attribute in which you can mention the paths of the external jars, but i tried it for log4j but it didn't work it gives me error 'Logger Class Def Not Found'. I had created the following manifest for that (Keeping the above exapmle in mind)
__________________
Main-Class: abc.def.main
Class-Path: lib\log4j.jar
__________________
but this didn't worked.
Then i came across a work around for this, which is you create a jar file of your project class files without adding the extenal libaries ie. using the following same manifest:
___________________
Main-Class: abc.def.main
___________________
Place the created jar files along with the external jar files in another folder and then use the following manifest to create the final jar file.
____________________
Main-Class: abc.def.main
Class-Path: main\test.jar lib\log4j.jar
____________________
Notice that test.jar is the jar file of your actual project. the final jar created using the above manifest will work for you.
Thursday, October 13, 2005
Camps & Medicines are needed more than anything else, Pakistan Intl. Airlines will carry donations for free.
http://news.google.com.pk/news?hl=en&ned=us&ie=UTF-8&q=earthquake+toll+40%2C000&btnG=Search+News
The winter has arrived and rain and hailstorms have severely hurt the rescue efforts. Please ask your local volunteers to collect as many donations as possible.
Lot of people in Pakistan are collecting donations and lots of cargo trucks, airplanes and helicopters have been dispatched to the affected areas, but the most important items that are short in supply are camps. No more camps are available in and around Lahore, and manufacturers have order for thousands of camps, but they won't be ready for many days.
2.5 million (possibly many more) people are left with no shelter, which means at least half a million camps are required.
The best thing would be to purchase camping equipment and medicines and send them to Pakistan, preferably Islamabad (because Islamabad is the closest big city, 95 km from Muzaffarabad, the epicenter) or Lahore (another 300km from Islamabad) because even with all the monetary aid, camps are not available here at all.
Pakistan International Airlines (PIA) will carry all relief goods for free from all of its stations in its global network ( http://www.piac.com.pk/press_release/pr293.asp)
Here are the url's of PIA's booking offices around the world alphabetized by cities:
http://www.piac.com.pk/b_offices/A.asp
(New York, Chicago, Houston in USA, Toronto in Canada)
List of PIA's worldwide Stations by Countries:
http://en.wikipedia.org/wiki/Pakistan_International_Airlines#Services
Links for online Donations: http://forums.anandtech.com/messageview.aspx?catid=38&threadid=1708958&enterthread=y
Please take action as quickly as possible, because the winter is here and the survivors are looking forward to our help. Feel free to contact me for any more information you need.
Thank you.
Thursday, October 06, 2005
DotNet Framework & IIS installation order
open the command prompt [For windows Xp and greater]
>>cd C:\WINDOWS\Microsoft.NET\Framework\v1.1.4322
>>aspnet_regiis.exe -i
In case you are using any other windows then search the aspnet_regiis.exe file and run this file from the command prompt with -i argument.
Note: Today one of my friend asked me about this problem and he told me that he is unable to find any solution of this problem on the net, so i though of publishing it on my blog. Hope it will help many.
Tuesday, September 06, 2005
You must try this utility.
http://xeustech.blogspot.com/2005/09/turtle-10.html
Friday, August 26, 2005
http://www.hostmysite.com/aspnet/
Enjoy ASP.NET 2.0 free web hosting
Tuesday, August 09, 2005
Two methods are created by default one is to start the webmethod asynchronously and other is to end the asynchronous call.
Sample Web Service:
public class AddService
{
[webmethod]
public int Add (int a,int b)
{
return a+b;
}
}
Sample Client:
public Class AddClient
{
private AddService serviceObject = null;
public AsyncCallback wsCallBack = null;
public void DisplayResults()
{
if ( wsCallBack == null )
{
wsCallBack = new AsyncCallback (AddResults);
}
serviceObject.BeginAdd(5,6,wsCallBack, new ReturnValue());
//Continue to do whatever you want to do
}
//This function is called when the Add webmethod returns
public void AddResults(IAsyncResult asyn)
{
ReturnValue rValue = (ReturnValue)asyn.AsyncState ;
int result = rValue.result; //this gives you the result
serviceObject.EndAdd(asyn);
}
}
//This call is used to represent the return value from the webmethod
Public Class ReturnValue
{
public int result;
}
Friday, August 05, 2005
What is the most furustrating thing in web applications, as compared to the dektop applications. It is the server trip, which most of the web application takes even if you change the seletion of a dropdownlist , it goes to the server to poulate another dropdownlist depending on the seletion we made.
With google introducting their new technologies like Gmail , Google Suggest and now Google Maps. It now seems poosible to have rich user experience on the web too. The google have used AJAX.
What is AJAX. In simple Asyncronus Javascript + XML. AJAX is a set of different technologies, that togater facilitates you to develop web application that offers rich user experience. I am working on a presentation on AJAX, i will soon upload it on my blog.
Some good reference on AJAX
- http://ajaxpattern.org
- Life Without Refresh by Dmitri Khanine and Phil Carrillo, July 2005.
- Ajax: A New Approach to Web Applications by Jesse James Garrett February 18, 2005 of Adaptive Path
- AJAX.NET webblog http://weblogs.asp.net/mschwarz/
Wednesday, August 03, 2005
http://csharp-source.net/
http://java-source.net/
