Tuesday, November 23, 2004

How to Disable IE AutoComplete in HTML Forms

Using Microsoft's Internet Explorer AutoComplete feature may save a lot of time on your personal PC or in an Intranet environment, but it can be a dangerous thing when creating web applications that involve sensative information. For example, if a user accesses your application at a web cafe and has AutoComplete turned "on", then walks away from the computer, the next person has free reign.

Fortunately, there is a simple solution to this problem. Just add the AutoComplete attribute to either the <form> tag or the <input> tag:
<form AUTOCOMPLETE="OFF">

... or...
<input type="text" name="name" AUTOCOMPLETE="OFF">


Sometimes the AutoComplete feature is a good thing, however, like in an Intranet environment where a user may have to enter the same information over and over. To better control this information as a web developer, the following article gives a good description of what you can do:

Developer's Dex: AutoComplete Feature of Internet Explorer

Tuesday, November 16, 2004

User.Config File

For those of you who wish there was a nice way to modify a web site project and not have to worry about changing workstation specific configuration settings in the web.config file (like datbase connection strings, etc.) you can use the file="user.config" attribute of the <appsettings> tag.

You can do the following in web.config:
<configuration>

<appsettings file="user.config">
<add key="Key" value="Value" >
</appsettings>
</configuration>
Then, create a file called user.config in the same folder as web.config, and paste the following code. Notice that there is no <configuration> tag:
<appsettings>

<add key="Key" value="Override value" >
<appsettings>

Do not add the user.config file to the project. If there is no user.config in the same folder, then the web.config settings are used.

MSDN:Web Projects Source Control Integration In VisualStudioNET


Thursday, November 11, 2004

Yahoo! Mail POP Access... for Free!

Ok, so I'm a cheap-skate... I admit it! I hate the idea of forking over $20 just so I can have access to my free Yahoo! mail account via Outlook. Well, thanks to a free application called YahooPops, you can POP your Yahoo! email at no cost to you.

Once you download and install the app, configuring Outlook 2003 is as follows:
  1. Select Tools -> Email accounts from the main menu
  2. Select Add a new email account and click o­n Next
  3. Select POP3 as the Server Type. Click Next
  4. Enter your username and full Yahoo! email address under 'User Information'
  5. Enter your Yahoo! Login id and password under 'Logon Information'
  6. Enter 'localhost' as your Incoming mail server
  7. Enter localhost as the SMTP server as your outgoing mail server
  8. Click o­n the More Settings button and select the Advanced tab
  9. Increase the Server Timeout to 'Long' (10 minutes)
  10. Select the Outgoing Server tab
  11. Enable "My outgoing server (SMTP) requires authentication". Select "Log o­n using" and enter your Yahoo Mail address as the username and your Yahoo Mail password as the password.
  12. Click Ok to close the More Settings dialog
  13. Click Next and then Finish

Can't Find get_asp_ver.aspx?

After adding an automatically error reporting feature to the global.asax file in my project, I started getting emails when I opened the project in VisualStudio.NET 2003 stating that the get_asp_ver.aspx file could not be found. This error only occurred on this one project, but none-the-less, it is apparently a problem others have had.

Microsoft suggests making a bogus get_asp_ver.aspx file, but many use this code in their global.asax.vb file which makes more sense to me than having a file in your site that does nothing:
Sub Application_BeginRequest(ByVal sender As Object, _

ByVal e As EventArgs)
Dim url As String = CStr(Request.ServerVariables("URL"))
If url.ToLower().IndexOf("get_aspx_ver.aspx") >= 0 Then
Response.End()
End If
End Sub

The ASPNET_regiis Tool

Ever have a problem with an ASP.NET site that didn't seem to have any reasonable explination? For example, I had an issue with a client where the client-side validation was not working on any of their web forms. The fix? Use the ASPNET_regiis tool to put a fresh copy of just the .NET Framework JavaScript for web validation (WebUIValidation.js) onto the server.

ASP.NET IIS Registration Tool

Debugging JavaScript

I'm not an expert JavaScript programming, but I do know enough to get-by, and I do know that it's insanely tedious to debug! Well, I should say it used-to be tedious, thanks to VisualStudio.NET and MSIE 6. To debug JavaScript, follow these steps:
  1. Make sure script debugging is not disabled in Internet Explorer.

    In MSIE: Tools > Internet Options... > Advanced > Uncheck "Disable Script Debugging (Internet Explorer)"

  2. Navigate to the page you wish to debug. The page doesn't have to be part of any VS.NET project, you can debug any web page you'd like.

  3. Open VS.NET. If you already have a ASP.NET project you are working on, open it. Otherwise, just open a new project which you will delete later.

  4. Start the VS.NET debugger (F5 or Debug > Start)

  5. In VS.NET, navigate to the Running Documents menu.

    In VS.NET: Debug > Windows > Running Documents

    The Running Documents menu should appear on the right. If the page you are debugging belongs to the project you are working on and is the page that is currently being debugged, it should already show-up in the running document list under "Microsoft Internet Explorer."

    If not, you have to attach to the MSIE process of the window you would like to work with. To do that:

    In VS.NET: Debug > Processes...

    Find the instance if iexplorer.exe that relates to the page you wish to debug. If there are multiple instance, look at the Title column to find the page. Select the page and click the Attach... button, then Close. You should now see the selected web page show-up in the Running Documents menu.

  6. Double click on the web page you wish to debug in the Running Documents menu. This should open up the HTML of the page in a new window. Now set a break-point on the line of code you which to start debugging, and away you go!