PranasLu's Blog

2009-07-13

VSPaste vs Code Snippet

Filed under: Programming — pranaslu @ 11:08

VSPaste testas:

protected void Application_Error(object sender, EventArgs e)
{
    // Code that runs when an unhandled error occurs
    // Sometimes Error.aspx can also have errors ;), so not to make recursive call
    if (Request.AppRelativeCurrentExecutionFilePath != "~/Main/Error.aspx")
    {
        Exception ex = Server.GetLastError();
        if (ex != null)
        {
            Guid errId = Nrd.Framework.Common.Logger.Write(ex, "Unhandled");
            NavigationService.Navigate("/Main/Error.aspx", new ErrorData() { ex = ex, ErrId = errId });
        }
    }
}

Code snippet:

 

   1: protected void Application_Error(object sender, EventArgs e)
   2: {
   3:     // Code that runs when an unhandled error occurs
   4:     // Sometimes Error.aspx can also have errors ;), so not to make recursive call
   5:     if (Request.AppRelativeCurrentExecutionFilePath != "~/Main/Error.aspx")
   6:     {
   7:         Exception ex = Server.GetLastError();
   8:         if (ex != null)
   9:         {
  10:             Guid errId = Nrd.Framework.Common.Logger.Write(ex, "Unhandled");
  11:             NavigationService.Navigate("/Main/Error.aspx", new ErrorData() { ex = ex, ErrId = errId });
  12:         }
  13:     }
  14: }

Leave a Comment »

No comments yet.

RSS feed for comments on this post. TrackBack URI

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

Create a free website or blog at WordPress.com.

%d bloggers like this: