Contact
Send mail to the author(s) Email Me

Disclaimer
The opinions expressed herein are my own personal opinions and do not represent my employer's view in any way.

Sign In
Navigation

Tag Cloud
.NET Framework (31) AJAX (9) ASP.NET (16) ASP.NET MVC (3) C# (32) Cloud (2) Database (6) Dev Community (2) Dev Tools (5) Enterprise Library (1) Futures (2) General (6) Javascript (7) LINQ (2) Mobile (1) MSDTC (5) Quotes (3) SQL (3) Transactions (4) Visual Studio (3) WAS (2) WCF (19) WIF (1)

Archive
<December 2007>
SunMonTueWedThuFriSat
2526272829301
2345678
9101112131415
16171819202122
23242526272829
303112345

Categories

Blogroll
Home Feed your aggregator (RSS 2.0)
# Wednesday, November 21, 2007
Wednesday, November 21, 2007 10:08:56 PM (Eastern Standard Time, UTC-05:00)  #    Comments [8]   .NET Framework | ASP.NET | C#  | 
# Thursday, August 16, 2007

It's only a week away, and there are still spaces left.

Information   Register    Sessions

Thursday, August 16, 2007 10:42:12 PM (Eastern Standard Time, UTC-05:00)  #    Comments [0]   .NET Framework | AJAX | ASP.NET | C# | Database | General | Javascript  | 
# Monday, July 16, 2007

Check out this mess.   I would like to see any one of the many people commenting to show one scrap of evidence to support their side of this issue.   All I see is "I read in an article that this was bad", "M$ said this is true", and my favorite argument "because that's what I think".   Great arguments for the third grade audience.   People... please try to prove something here with some real evidence.

I happen to believe stored procedures are the way to go because Elvis landed in a spaceship in my front yard and told me to only use stored procedures.

http://weblogs.asp.net/fbouma/archive/2003/11/18/38178.aspx

Monday, July 16, 2007 8:35:00 AM (Eastern Standard Time, UTC-05:00)  #    Comments [4]    | 
# Saturday, March 03, 2007

The CaptchaImage images and comments worked fine on my local machine.   With no difference in settings or permissions, my site threw javascript errors when saving comments, and the CaptchaImage images failed to appear.   I tried to research it, but found only one person that claimed to have the same issue with no resolution.

I read many posts saying that using dasBlog 1.9.6264.0 on 2.0 Framework had serious issues.   I couldn't believe what I was reading since everything was working fine in 2.0 on my local machine, and only the comments were failing on my site.   I changed the app to use the 1.1 Framework and made the required web.config changes.   The result: add two more items to the list of things that don't work on dasBlog 1.9.6264.0 with 2.0 Framework.

Look ma, comments are working!

Saturday, March 03, 2007 1:51:58 PM (Eastern Standard Time, UTC-05:00)  #    Comments [5]    | 
# Saturday, February 10, 2007

Many hosting companies, like mine, won't have the AJAX Extensions installed in the GAC for quite a while, if ever.   No worries, you can just put the DLLs in your Bin folder.   Since MS hasn't graced us with the DLLs, so you'll have to get them out of your GAC.  I haven't found a way to copy DLLs using Windows Explorer, but command-line never fails.

copy "C:\WINDOWS\assembly\GAC_MSIL\System.Web.Extensions\1.0.61025.0__31bf3856ad364e35" C:\dev\MyApp\Bin\
copy "C:\WINDOWS\assembly\GAC_MSIL\System.Web.Extensions.Design\1.0.61025.0__31bf3856ad364e35" C:\dev\MyApp\Bin\

Saturday, February 10, 2007 2:50:00 PM (Eastern Standard Time, UTC-05:00)  #    Comments [4]   .NET Framework | AJAX | ASP.NET  | 

I frequently place an UpdatePanel around a paged GridView with inline editing.   During OnRowUpdating, the object is saved.   If the save was not successful, I like to show an alert box with the error message.  

I recently migrated from the Atlas May CTP to ASP.NET 2.0 AJAX.   The following code worked with the May CTP, but, from my research, has not worked since July CTP:

Page.ClientScript.RegisterStartupScript(typeof(string), "alertScript", "alert('Error Message');", true);

However, our pals at Microsoft have given us something just as good.   I found it by mistake while trying to put in a hack involving checking the value of ScriptManager.GetCurrent(Page).IsInAsyncPostBack.  Here is the AJAX-friendly equivalent:

ScriptManager.RegisterStartupScript(this.updatePanel, typeof(string), "alertScript", "alert('Error Message');", true);

Hope this helps someone.  There are many blog posts, with many more comments, with people compaining about this.

Saturday, February 10, 2007 8:21:42 AM (Eastern Standard Time, UTC-05:00)  #    Comments [30]   AJAX | ASP.NET  | 
# Wednesday, February 07, 2007

I just migrated from the Atlas July CTP to ASP.NET 2.0 AJAX Extensions 1.0.  After following all of the instructions on the AJAX site, my web site still showed tons of errors.  I'm using a Web Site, not Web Application, with a ScriptManager in a WebForm that uses a MasterPage.   Every page shows errors on AJAX tags. 

Yes, I removed the Atlas DLL.  No, my web.config is not messed up.  Something else is wrong here.   I found a "fix".   The sequence of steps seems a little odd to me, but I did't care, it worked.  However, the problem resurfaced when I closed my MasterPage.

More searching led me to a great alternative to a true solution.   An ASP.NET Forums post had some back-and-forth on the topic.  Ultimately, the best solution at this point is to change the tagprefix to "ajax".   This works great, and, in fact, I like it better because it separates the ajax controls from the standard asp controls.

<add tagPrefix="ajax" namespace="System.Web.UI" assembly="System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35"/>

Wednesday, February 07, 2007 9:34:09 PM (Eastern Standard Time, UTC-05:00)  #    Comments [0]   AJAX | ASP.NET  | 
# Wednesday, January 24, 2007

In preparing for a recent business trip, I decided to lookup the TSA's current prohibited items list.   You can download the list at http://www.tsa.gov/assets/pdf/prohibited-and-permitted-items.pdf.   Does anyone else find an item on this list that doesn't make sense?

Wednesday, January 24, 2007 2:52:53 AM (Eastern Standard Time, UTC-05:00)  #    Comments [3]   General  | 
# Monday, November 06, 2006

I frequently store documents in the database for my ASP.NET apps, eliminating web farm complications with shared drives, permissions, etc.  When uploading a file, my Document class reads the uploaded file, zips the file with SharpZipLib, and inserts/updates in the database.   When opening a file, I have always used an ASPX page that uses the Document class to unzip the file, and then changes the Content-Disposition and ContentType headers, and then does a BinaryWrite to the Response object to display the file.

I have been using Handlers a lot lately, and figured that it was time to make this process a little more elegant.  If you've never written a handler, it's quite simple.  You need to make a web.config change, and add a new class that implementts IHttpHandler.  All of the work is done in ProcessRequest.  Using the default .ashx extension for the handler eliminates the need to make any changes in IIS.  I thought about changing the handler to accept all requests with known file extensions with the document ID as the filename, like 3383.pdf.  I just figured that using the default extnesion would be easier.   Laziness or efficiency, you decide.  Check out the code.

In <system.web> in web.config:


<httpHandlers>
   
<add verb="*" path="DocumentHandler.ashx" type="TestingWebApp.DocumentHandler, TestingWebApp" />
</httpHandlers>

DocumentHandler.cs:


using System;
using System.Web;

namespace TestingWebApp
{
    public class DocumentHandler : IHttpHandler
    {
        private int DocumentId
        {
            get
            {
                if(System.Web.HttpContext.Current.Request.QueryString["DocumentId"] != null && System.Web.HttpContext.Current.Request.QueryString["DocumentId"].ToString().Length > 0)
                    return Convert.ToInt32(System.Web.HttpContext.Current.Request.QueryString["DocumentId"]);
                else
                    throw new ApplicationException("Document Handler requires a DocumentId");
            }
        }

        #region IHttpHandler Members

        public void ProcessRequest(System.Web.HttpContext context)
        {
            context.Response.Cache.SetCacheability(HttpCacheability.Public);
            context.Response.BufferOutput = false;
            
            Document document = Document.GetDocumentByDocumentId(this.DocumentId);

            byte[] buffer = document.UnzippedBinary;
            context.Response.ContentType = document.ContentType;
            context.Response.OutputStream.Write(buffer, 0, buffer.Length);
        }

        public bool IsReusable
        {
            get { return true; }
        }

        #endregion
    }
}
Monday, November 06, 2006 11:31:15 PM (Eastern Standard Time, UTC-05:00)  #    Comments [5]   .NET Framework | ASP.NET | C# | Database  | 
Copyright © 2010 Scott Klueppel. All rights reserved.