In this article i would like to show you a simple code to validate User input to accept Email Address in Text Box control.
The traditional approach is to OnLostFocus event of Text Box we call a Java Script to read all the characters on by one to validate the entered the input valid email address or not. That is looking for @ symbol and using some blind rules.
Its really difficult to validate email address because now a days we see somany domains providing unique way to create email address. This is time consuming process to validate all such cases. Instead if you are familiar with Regular Expression the it becomes your life easier.So here i am going to give you simple example to validate email address in text box.
Lets look at the below code:
Wednesday, April 29, 2009
Validate Email Address using Regular Expression Control in ASP.NET
Validate Numbers Using Regular Expression in ASP.NET
In this article i would like to show you a simple code to validate User input to accept only Numbers in Text Box control.
Most traditional approach is to OnLostFocus event of Text Box we call a Java Script to read all the characters on by one to validate the entered the input is Number or not. This is time consuming process. Instead if you are familiar with Regular Expression the it becomes your life easier.
So here i am going to give you simple example to validate numbers in text box. Lets take simple case where in i want to validate Salary.
Wednesday, December 31, 2008
Create CLR Stored Procedure
With the latest version of SQL Server 2005, we have the the ability to write CLR from any .Net language.
Lets dig into more details:
I have started leaning C#, so let me show you how to write this code in C#. Please bare with me on the logic :)
Step:
1. Start Visual Studio 2005
2. Add new file
3. Select Class with C#
4. Mark the name as DemoProcCls.cs and write the below lines of code.
using System.Data.SqlServer;
using System.Data.SqlTypes;
public class DemoProcCls
{
public static void DemoProc()
{
SqlPipe sqlPipe = SqlContext.GetPipe();
sqlPipe.Send("Hello World");
}
}
i) Compile the code into assembly
You need to find out the SQL Server path of "sqlaccess.dll".
csc /target:library D:\DemoProcCls.cs /r:"
ii) Load the above created assembly in SQL with the use of CREATE PROCEDURE
create procedure SampleDemoProc
as external name DemoProcCls.DemoProcCls.DemoProc
and execute the stored procedure as
exec SampleDemoProc
Thursday, December 11, 2008
ASP.NET Caching Part 2
Data Caching
So we know that we can cache an entire page, or a fragment of a page by caching down to the user control level. Wouldn’t it be great if we could cache down to the object level? The good news is you can with ASP.NET Data caching.
The cache consists of a dictionary collection that is private to each application in memory. To insert items in the cache simply provide the collection with a unique name:
Cache["USER_id"] = myObject;
Retrieving the object form the cache:
myObj = (MyObj)Cache["USER_id"];
It is a good time to point out that you should always remember to check for null, and be sure to caste to your datatype.
Cache Configuration
If you are familiar with how caching worked in ASP.NET 1.0, you realize that managing all the cache directions for all your pages could potentially get out of hand. ASP.NET 2.0 introduces Cache Profiles that helps you centrally manage your cache. Cache settings can be inherited by your pages, and overridden if required by using the OutputCache directive.
The page directive looks pretty much the same, expect this time it references a cache profile that you defined in your web.config file.
<%@ Page Language=”C#” %>
<%@ OutputCache CacheProfile=”testCacheProfile” VaryByParam=”none” %>
So each and every page that references the ‘testCacheProfile’ can be centrally managed in the web.config, this means that any changes to the cache settings in the web.config file will be automatically changed on all your referenced pages.
Friday, November 21, 2008
config files in .Net
Web.config:--Basically this file is use for web setting or we can say web.config file contains setting to a web application.
Machine.config:--Settings to a computer and that help to configure all application into same machine.
Example:--
In a machine it can be more then one web application so each application will have one or more web.config files depend on configuration level of folders but in that system there will be one machine.config file.
Overview of ASP.NET 3.5
ASP.NET has for long been a popular web application development platform. ASP.NET 2.0 added a lot of new features compared to its earlier counterpart, i.e., ASP.NET 1.1. With ASP.NET 3.5, you have even more features. This article will present the new features that have been added to ASP.NET and Visual Studio 2008.
In ASP.NET 3.5, a new tool has been introduced called the ASP.NET Merge Tool. You can use this tool for merging pre-compiled assemblies. No, this is not all. There isa lot of other exciting features and we will explore each of them as we progress through this article.
The most significant improvements in ASP.NET are:
* Integrated Ajax Support
* New Data Controls (ListView and DataPager)
* The LinqDataSource Control
Visual Studio 2008 has also included some features for an improved web application development experience. Here is the list of such improvements:
* Support for LINQ
* IntelliSense for JavaScript and ASP.NET Ajax
* Improved Design time experience
Please refer to below link for detailed explantion
http://aspnet.4guysfromrolla.com/articles/112107-1.aspx
Thursday, September 11, 2008
Framework 3.5 Service Pack 1
Microsoft .NET Framework 3.5 Service Pack 1 is a full cumulative update that contains many new features building incrementally upon .NET Framework 2.0, 3.0, 3.5, and includes cumulative servicing updates to the .NET Framework 2.0 and .NET Framework 3.0 subcomponents.
Some of the new features and improvements:
Core improvements to the CLR (common language runtime) that include better layout of .NET Framework native images, opting out of strong-name verification for fully trusted assemblies, improved application startup performance, better generated code that improves end-to-end application execution time, and opting managed code to run in ASLR (Address Space Layout Randomization) mode if supported by the operating system. Additionally, managed applications that are opened from network shares have the same behavior as native applications by running with full trust.
Performance improvements to WPF (Windows Presentation Foundation), including a faster startup time and improved performance for Bitmap effects. Additional functionality for WPF includes better support for line of business applications, native splash screen support, DirectX pixel shader support, and the new WebBrowser control.
Windows Communication Foundation now makes the DataContract Serializer easier to use by providing improved interoperability support, enhancing the debugging experience in partial trust scenarios, and extending syndication protocol support for wider usage in Web 2.0 applications.
The .NET Framework Data Provider for SQL Server (SqlClient) adds new support for file stream and sparse column capabilities in SQL Server 2008.
upgrade yourself from below link
http://www.microsoft.com/downloads/details.aspx?familyid=ab99342f-5d1a-413d-8319-81da479ab0d7&displaylang=en
umbraco
umbraco is an open source project with roots back to year 2000 even though it wasn't released as open source until 2004. Prior to that it was founder Niels Hartvig's home-grown weapon of choise for working as a freelancer.
Today it has grown to be among the top fifteen most popular open source .NET applications and in May 2008 we hit a milestone at 50.000 installed and active websites (double up from 25.000 in April 2007).
Check out the below link for more information..
http://www.umbraco.org/
Friday, July 4, 2008
IIS 7.0
Windows Server 2008 featuring Internet Information Services 7.0 is a powerful Web application and services platform that delivers rich Web-based experiences. It offers improved administration and diagnostic tools to help achieve lower infrastructure costs on a variety of popular development platforms. With improved reliability and scalability, IT professionals and developers can manage the most demanding Web serving environments, from a single Web server to a large Web farm.
Download IIS @
http://www.microsoft.com/windowsserver2008/en/us/trial-software.aspx
Thursday, June 19, 2008
Side-by-side execution
Side by Side Excution enables the existence of multiple
versions of .Net Framework on the same machine at the same
time and also multiple versions of applications that use a
version of the .Net Framework.
Also the side by side implenetation requires the use of a
startup Shim.
Shim is a thin piece of code that accepts a Version No and
other start up parameters from host to start the CLR.
Startup shim is implemented in the mscoree.dll.
Only one version of the shim exists in the machine and is
available in the System 32 folder.


