I get an error in live application sometimes.
Stack trace:
at Tool.User_RequestSender.Page_Load(Object sender, EventArgs e) in d:\Site\Tool\User\RequestSender.aspx.cs:line 72 at System.Web.Util.CalliHelper.EventArgFunctionCaller(IntPtr fp, Object o, Object t, EventArgs e) at System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object sender, EventArgs e) at System.Web.UI.Control.OnLoad(EventArgs e) at System.Web.UI.Control.LoadRecursive() at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
I tried again and again to run code om my machine but could not get same error.
Even i live code i get this issue once in while.
Page_Load Code in RequestSender.aspx.cs:
protected void Page_Load(object sender, EventArgs e)
{
try
{
if (!IsPostBack)
{
this.LoadRequest();
}
}
catch (CustomException ex)
{
this.ShowMessage(ex.Message);
}
catch (Exception ex)
{
throw ex;
}
}
LoadRequest() is as follows:
private void LoadRequest()
{
Credential credential;
if (
!string.IsNullOrEmpty(Request["typeOfrequest"]) &&
!string.IsNullOrEmpty(Request["empUserId"]) &&
!string.IsNullOrEmpty(Request["applicationId"])
)
{
// Get details of credentials
credential = (new RequestManager()).GetCredential(this.EmpUserId, this.ApplicationId, (int)this.TypeOfrequest);
this.applicaionRequest = new Request
{
RequestType = this.TypeOfrequest,
RequestStatus = Enumerations.RequestStatus.Sent,
Application = credential.Application,
EmpUserId = credential.EmpUserId,
EmployeeId = credential.EmployeeId,
Username = credential.Username,
SenderAddress = Security.CurrentUser.Details.EmailAddress,
ReceiverAddress = (new Datastore.RequestStore()).GetReceiverAddress((int)this.TypeOfrequest, this.ApplicationId),
AddedBy = Security.CurrentUser.Details.UserId
};
ucSendRequest.ApplicationRequest = applicaionRequest;
}
else
{
Response.Write("Invalid request!");
Response.End();
}
}
}
catch(Exception ex) { throw ex; }
is masking the original cause. Get rid of that catch block and you'll get a better idea of what's going on. – Jon Skeet