Ray Asp.net Blog

ASP.NET/MVC/JQuery

How to filter Exceptions (Such as null parameter) in MVC?

Override your OnException in your controller:
protected override void OnException(ExceptionContext filterContext)
{
if (IsNullParamter(filterContext.Exception))
filterContext.HttpContext.Response.Redirect("~/Home/Index");
base.OnException(filterContext);
}

private bool IsNullParamter(System.Exception ex)
{
string error = ex.Message;
if (error.Contains("System.ArgumentException: The parameters dictionary contains a null entry for parameter")) return true;
if (error.Contains("The parameters dictionary contains a null entry for parameter")) return true;
return false;
}

November 11, 2009 Posted by rayaspnet | Uncategorized | | No Comments Yet

The Microsoft Ajax Library and Visual Studio 2010

October 23, 2009 Posted by rayaspnet | Uncategorized | | No Comments Yet

Architecture Tools in VSTS 2010, UML tool

October 21, 2009 Posted by rayaspnet | Uncategorized | | No Comments Yet

Microsoft preps .NET 4.0 – framework improves on REST, MVC, JQuery support

October 21, 2009 Posted by rayaspnet | Uncategorized | | No Comments Yet

MVC Cheat sheets

October 13, 2009 Posted by rayaspnet | Uncategorized | | No Comments Yet

Microsoft AJAX CDN, JQuery lib

Source
http://ajax.microsoft.com/ajax/jquery/jquery-1.3.2.min.js

September 16, 2009 Posted by rayaspnet | Uncategorized | | No Comments Yet

How to improve the performance of ASP.NET MVC web application

Source

Implementing Caching
Implementing HTTP Compression
Implementing JQuery UI library with Google Hosted Ajax Libraries
By combining scripts and other resources
Deploying production code in release mode
Removing default HTTP modules in ASP.NET
Optimizing URL generation

September 11, 2009 Posted by rayaspnet | Uncategorized | | No Comments Yet

Using ELMAH with ASP.NET MVC

link

Insert following part after configSections after third steps

<elmah>
<security allowRemoteAccess="yes" />
<errorLog type="Elmah.XmlFileErrorLog, Elmah" logPath="~/App_Data" />
<errorMail
from="aaa@aaa.aa"
to="aaa@aaa.aa"
subject="ICM Exception …"
async="true"
smtpPort="25"
smtpServer="0.0.0.0"
userName=""
password="" />
</elmah>

August 21, 2009 Posted by rayaspnet | Uncategorized | | No Comments Yet

Test Credit Card Account Numbers

Visa 4111111111111111
Link

August 21, 2009 Posted by rayaspnet | Uncategorized | | No Comments Yet

Telerik Extensions for ASP.NET MVC

August 12, 2009 Posted by rayaspnet | Uncategorized | | No Comments Yet