Server Error in '/' Application.

Parameter is not valid.

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.ArgumentException: Parameter is not valid.

Source Error:


Line 51:                 Image.GetThumbnailImageAbort myCallback = new Image.GetThumbnailImageAbort(ThumbnailCallback);
Line 52:                 //creat BitMap object from image path passed in querystring
Line 53:                 Bitmap myBitmap = new Bitmap(context.Server.MapPath(imgPath));
Line 54:                 //create unit object for height and width. This is to convert parameter passed in differen unit like pixel, inch into generic unit.
Line 55:                 System.Web.UI.WebControls.Unit widthUnit = System.Web.UI.WebControls.Unit.Parse(imgwidth);

Source File: e:\HostWeb\daidoangia.vn\WebService\ImageResize.ashx    Line: 53

Stack Trace:


[ArgumentException: Parameter is not valid.]
   System.Drawing.Bitmap..ctor(String filename) +639340
   ImageResize.ProcessRequest(HttpContext context) in e:\HostWeb\daidoangia.vn\WebService\ImageResize.ashx:53
   System.Web.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +542
   System.Web.HttpApplication.ExecuteStepImpl(IExecutionStep step) +75
   System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +93


Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.8.4465.0