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"
The solution was simple.
- Open IIS, right click on the local computer name and select 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 (*).
That simple! Good luck :)
cf34b6b6-bb17-41b8-9e30-ba12da7f74c1|1|5.0
Tags: iis, asp.net
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.
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!
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!