The basic difference between them is “Convert” function handles NULLS while “i.ToString()” does not it will throw a NULL reference exception error. So as good coding practice using “convert” is always safe.
Archive for January, 2007
Multithreading in ASP.NET
Multithreading is a technique that can be used to perform time consuming tasks in a separate additional thread other than the main application thread. Each time a thread is created, a certain amount of memory is consumed to hold this thread context information. Hence, the number of threads that can be created is limited by the amount of available memory.
Instead of creating a thread each time we need one, and then destroying it after finishing, the .NET framework introduces the concept of thread pool. In the thread pool technique, and instead of creating a new thread whenever you need one, your application will obtain a thread from the thread pool. After that obtained thread completes its task, it will be returned to the thread pool instead of destroying it – waiting for the next acquiring. This reusability increases the overall application performance, and reduces the cost of excessive thread creation and termination.
To make use of this technique, you need to use the System.Threading.ThreadPool class. The thread pool will be created the first time you use it. The number of total threads in this pool is restricted by default to 25 threads. This means that all of these 25 threads may be busy at some point. If you need to acquire a new thread at this point, your task will be scheduled waiting for a thread to finish its task and return to the pool.
http://www.beansoftware.com/ASP.NET-Tutorials/Multithreading-Thread-Pool.aspx
Starting with Framework 3.0 …..
The Microsoft .NET Framework version 3.0, formerly WinFx, is the next version of the Microsoft developer platform. The .NET Framework 3.0 consists of the existing .NET Framework version 2.0 components as well as four new developer-focused innovative technologies: Windows Presentation Foundation (WPF), Windows Communication Foundation (WCF), Windows Workflow Foundation (WF), and Windows CardSpace (CardSpace). The .NET Framework 3.0 ships with Windows Vista and is available for Windows XP SP2 and Windows Server 2003.
ASP.NET 2.0 CSS Friendly Control Adapters 1.0
ASP.NET is a great technology for building web sites but it would be even better if it provided more flexibility for customizing the rendered HTML. For example, the Menu control makes it simple to add a menu to a web site, but it would be better if it didn’t create <table> tags and was easier to style using CSS. Happily, it’s easy to customize and adapt the Menu control to generate better HTML. Indeed, you can modify any ASP.NET control so it produces exactly the HTML you want.The key is to use something that may be new to you: control adapters. These are little chunks of logic that you add to your web site to effectively “adapt” an ASP.NET control to render the HTML you prefer. The ASP.NET 2.0 CSS Friendly Control Adapters kit provides pre-built control adapters that you can easily use to generate CSS friendly markup from some of the more commonly used ASP.NET controls.
http://www.asp.net/cssadapters/
Enable Property Grid in Source View
If you want to re-enable the property grid in source mode so that it is dynamically updated as you cursor through the document, simply open the Tools->Options menu item and click the “Enable Property Grid in Source View” configuration option within the Text Editor->Html->Miscellaneous category. You can download it from http://msdn.microsoft.com/vstudio/support/vs2005sp1/default.aspx . 
Problem with scrolling with TableLayoutPanel
Hi guys,
I have a simple problem with my windows application developed in .NET.
I have a table layout panel which has 4 columns having serial number, checkbox, textbox and a rick text box. When the focus is on rich text box i m not able to scoll the table layout panel but when focus is on checkbox or textbox, scrolling works. I guess as rich textbox is a container it has its on scroll bars which fires first when focus is inside it. But then too i want scrolling of a table layout panel. Any Idea / comments ?
Restore Default Project Templates
I was confused what to do when i found my default VS templates are gone somehow. But then i found how to restore it back.
- In the command prompt, navigate to the location of devenv.exe. This file is located in <Visual Studio Installation Path>\Common7\IDE.
- Type “devenv /installvstemplates” and press Enter.
app_offline.htm feature in ASP.NET 2.0
Basically, if you place a file with this name in the root of a web application directory, ASP.NET 2.0 will shut-down the application, unload the application domain from the server, and stop processing any new incoming requests for that application. ASP.NET will also then respond to all requests for dynamic pages in the application by sending back the content of the app_offline.htm file (for example: you might want to have a “site under construction” or “down for maintenance” message).
Register User Controls and Custom Controls in Web.config
ASP.NET 2.0 makes control declarations much cleaner and easier to manage. Instead of duplicating them on all your pages, just declare them once within the new pages->controls section with the web.config file of your application
<?xml version=”1.0″?>
<configuration>
<system.web>
<pages>
<controls>
<add tagPrefix=”scottgu” src=”~/Controls/Header.ascx” tagName=”header”/>
<add tagPrefix=”scottgu” src=”~/Controls/Footer.ascx” tagName=”footer”/>
<add tagPrefix=”ControlVendor” assembly=”ControlVendorAssembly”/>
</controls>
</pages>
</system.web>
</configuration>
<html>
<body>
<form id=”form1″ runat=”server”>
<scott:header ID=”MyHeader” runat=”server” />
</form>
</body>
</html>
Deleting ASP.NET 2.0 Application Sub-Directories Shuts Down the AppDomain
This issue seems to be coming up recently since ASP.NET 2.0 shipped; probably because this behavior has changed from previous versions. In previous versions ASP.NET did not care if you deleted sub-directories of the web application and it appears some folks actually depended on this behavior and now when upgrading to ASP.NET 2.0 are finding their AppDomains are restarting after deleted a sub-directory.