IIS 6.0 serving unknown file extensions?

by aherrick 17. November 2008 10:25

We were working on a web project that was served on IIS 6.  In the code, we were creating our own extensions (.BUYER, .PACK., .ITEM) for example.  The problem occurred when these files became unavailable for download when running the site through IIS. 

"Internet Explorer cannot download X"

iis6 cannot download

The solution was simple. 

  1. Open IIS, right click on the local computer name and select properties.

iis 6 properties

    2.   Select "MIME Types"

    3.   Select "NEW"  

    4.   Input the extension and application/octet-stream for MIME Type.  If you want to allow ALL extensions, add an asterick (*).

iis6 mime type

That simple!  Good luck :)

Tags: ,

Ajax Control Toolkit Autocomplete Extender Weird Issue

by aherrick 20. August 2008 05:08

Okay I was working on testing the Autocomplete Extender on a site I am working on.  I noticed something interesting when testing the search functionality.  Take a look at what was going on:

Here is what the control source looked like:

As you can see, the SKU codes I was looking for started with "TEST". But if a bunch of junk text was included before the actual SKU, it would stay with it in the dropdown list.  I finally found the solution by removing the "DelimiterCharacters" from the control.  I hope this works for you!

On an unrelated note I accepted a full time position at Blue Horseshoe Solutions today, I am thrilled.

Tags: , ,

Validate Page on Submit Before Custom Javascript

by aherrick 12. August 2008 23:55

I was working on form submit where I wanted to prompt with a simple Javascript confirm dialog when the user clicks the submit button on the form.  Naturally, all the form fields (name, adress, etc.) I setup using required field validators.  My custom javascript confirm originally looked like this.

 

I called the javascript from the code behind.

The big problem I found was that the javascript confirm function was being called regardless of if the page completely validated or not.  I wanted the functionality to first validate the page, then if the page was valid, run the custom code.   I came up with this code using Page_IsValid.  It uses Page_ClientValidate() to validate the page, then I check if the page is valid.  Simple yet effective! 

Good luck!

Tags: , , ,

Encrypt and Decrypt Connection String in web.config

by aherrick 23. July 2008 03:55

It can be a good idea to encrypt your connection string before deployment of an web application in ASP.NET.  Plus, it's easy!  Let me show you how.

In command prompt (start -> run -> cmd) navigate to your Asp.Net directory usually found at %WINDOWS%\Microsoft.Net\Framework\version

If you have already setup your application in IIS use the following synatx to encrypt:

aspnet_regiis -pe "connectionStrings" -app "/YourApplicationHere"

Similarly to decrypt:

aspnet_regiis -pd "connectionStrings" -app "/YourApplicationHere"

One thing to note, make sure you are encrypting the connection string on the production box. It will not work to encrypt your connection string on another box and move your web.config into production.

Let me know if this worked for you!

Tags: ,



Powered by BlogEngine.NET 1.5.0.7
Theme by Mads Kristensen
Tweaked by ajondeck.NET

About the author

Andrew Herrick
I am a full time developer for Blue Horseshoe Solutions based out of Carmel, Indiana. I enjoy learning new technology and hope to give back with some of the cool things I pick up along the way.  Check me out on Stack Overflow!


Categories

None

Recent comments

Comment RSS

Disclaimer

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

© Copyright 2008