DuraSoft TechLet 02, 2003
|
Welcome
to the February 2003 TechLet. If you have received this through some one you know and
would like to subscribe directly for our future issues, please send an email to
techlet@durasoftcorp.com with a subject subscribe. This subscription currently
is absolutely free.
In this issue, we have a detailed article on Custom Error Pages in ASP.NET |
|
If you like any question to be addressed or topic to be discussed, please send
us an email to techlet@durasoftcorp.com. At the end of the year, one person
will be randomly selected from the list of respondents for a special prize. We
would like to hear from you.
Please send suggestions, corrections and comments to techlet@durasoftcorp.com. Our presentation on integration of .NET and Java Web Services was very well received in Dallas and Atlanta symposiums back in November. We will be presenting that at a symposium in Austin in February. If you are interested in downloading and reviewing the presentation, please visit http://www.durasoftcorp.com/download and look in the Presentations section. |
| Custom Error Pages in ASP.NET All web applications are prone to throw two kinds of errors, conditional and unconditional. Conditional errors are related to the business logic specific rules, whereas unconditional errors may occur due to a network slowdown, database crash, server breakdown, etc. All these errors, if left untouched may manifest in a clumsy way threatening the audience. ASP.NET provides various error handling techniques to elegantly trap and handle the errors. This article talks about the use of the web configuration file to corner the errors and prop up customized error pages in the application. The complete article can be found at http://www.durasoftcorp.com/download |
|
The following code does not compile. Make minimal change
(one word) to fix it. Explain the reason why Java compiler insists on
this change? Send your response to techlet@durasoftcorp.com,
and you may become the winner of this year's TechLet special prize.
public class Test
{
public static void call(Test obj)
{
new Thread(new Runnable()
{
public void run()
{
obj.doSomething(); // Perform in a new thread.
}
}
).start();
}
public void doSomething()
{ // does some thing...
}
}Quiz from the past issue In the article "How to create/avoid memory leak in Java and .NET?" we discussed how .NET provides the IDisposable interface as a streamlined standard interface for resource garbage collection. A user of an object should check to see if the class implements the IDisposable interface and then call the Dispose method to release the resources utilized by the object. What keyword does C# provide to help with this process, in a way that this dispose mechanism may be semi automated. Answer! The keyword provided in C# for automating the call to Dispose is using. Consider the following code:
public class Test : IDisposable
{
public void f()
{
Console.WriteLine("f called");
}
public void Dispose()
{
Console.WriteLine("Dispose called");
}
}
public class User
{
public static void Main()
{
using(Test obj = new Test())
{
obj.f();
}
}
}
The output of the program is
f called Dispose called |
| In their capacity as a tool, computers will be but a ripple on the surface of our culture. In their capacity as intellectual challenge, they are without precedent in the cultural history of mankind - Edsgar Dijkstra. |