Friday, 04 March 2005
ASP.NET User Control to Check for Javascript

Many ASP.NET sites rely on javascript being available and enabled on the browser. This self-contained user control has 3 tricks that will help you deal with the lack of javascript. If javascript is not running on the browser then:

  • A message is displayed (actually the message is hidden if javascript is running)
  • An event is raised
  • (optionally) The request is redirected to a new url

All the documentation is in the control source. Save this source as CheckJavascript.ascx , add it to your site and hopefully you will have fewer support calls.

<%@ Control Language="vb" AutoEventWireup="false" Inherits="System.Web.UI.UserControl" %>
<script runat="server">
' Copyright 2005 by Structured Solutions
'
' This work is licensed under the Creative Commons Attribution-ShareAlike License.
' To view a copy of this license, visit http://creativecommons.org/licenses/by-sa/2.0/
' or send a letter to Creative Commons, 559 Nathan Abbott Way, Stanford, California 94305, USA.
'
' Revision History
' =============================================================================================
' Mar 04, 2005 Initial release
'
' This control will display a message to the customer if their browser is not running
' javascript. The way this works is that the message is hard coded (see below). If
' javascript is running the message is hidden by the browser. If javascript is not
' running the message remains visible.
'
' To use this control, place this line at the top of the page (aspx) or control (ascx)
' file in which you want the message to appear:
'
' <%@ Register TagPrefix="uc1" TagName="CheckJavascript" Src="CheckJavascript.ascx" %>
'
' Src is the path this file relative to the page or control file you are changing.
' Place this line where you want the message to appear:
'
' <uc1:CheckJavaScript id="CheckJavascript" runat="server" />
'
' The message is all the way at the bottom of this file.
'
' =====================================================================================
' Advanced feature: NoJavascript event
' =====================================================================================
Public Event NoJavascript As EventHandler
'
' This event is raised after a submit if the browser is not running
' javascript. This allows you to add an ASP.NET handler to your page
' to take some special action. This is not required...it's just here
' for completeness.
'
' <uc1:CheckJavaScript id="CheckJavascript" runat="server" OnNoJavascript="MyHandler" />
'
' =====================================================================================
' Advanced feature: NoJavascriptUrl
' =====================================================================================
Public NoJavascriptUrl As String
'
' The browser will be redirected to this url after a submit if the
' browser is not running javascript. This allows you to add a landing
' page for customers that do not have javascript enabled. This is not
' required. If the string is empty, the browser will never be redirected.
'
' <uc1:CheckJavaScript id="CheckJavascript" runat="server" NoJavascriptUrl="SorryNoSale.html" />
'
' =====================================================================================
' The rest of this script has the code that implements the various functions.
' =====================================================================================
Protected Overrides Sub OnPreRender(ByVal e As System.EventArgs)
MyBase.OnPreRender(e)
If Me.Controls.Count > 0 Then
' Wrap the inner HTML in a <span> so it can be hidden
Dim innerHtml As Control = Me.Controls(0)
Me.Controls.Remove(innerHtml)
Dim span As New WebControl(HtmlTextWriterTag.Span)
span.ID = "span"
span.Controls.Add(innerHtml)
Me.Controls.Add(span)

' Create a javascript that will hide the span
Dim script As New System.Text.StringBuilder
script.AppendFormat("<script type=""text/javascript"" language=""javascript""> {0}", Environment.NewLine)
script.AppendFormat("<!-- {0}", Environment.NewLine)
script.AppendFormat(" if (document.getElementById) {{ {0}", Environment.NewLine)
script.AppendFormat(" if (document.getElementById(""{0}"")) {{ {1}", span.ClientID, Environment.NewLine)
script.AppendFormat(" document.getElementById(""{0}"").style.display = 'none'; {1}", span.ClientID, Environment.NewLine)
script.AppendFormat(" }} {0}", Environment.NewLine)
script.AppendFormat(" if (document.getElementById(""{0}"")) {{ {1}", ClientID, Environment.NewLine)
script.AppendFormat(" document.getElementById(""{0}"").value = ""1""; {1}", ClientID, Environment.NewLine)
script.AppendFormat(" }} {0}", Environment.NewLine)
script.AppendFormat(" }} {0}", Environment.NewLine)
script.AppendFormat("//--> {0}", Environment.NewLine)
script.Append("</")
script.AppendFormat("script> {0}", Environment.NewLine)
Page.RegisterStartupScript(script.ToString, script.ToString)

' Create a hidden field that will be examined during a submit for evidence of javascript
Page.RegisterHiddenField(ClientID, "0")
End If
End Sub

Private Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles MyBase.Load
If Page.IsPostBack Then
If Request(ClientID) <> String.Empty Then
If Request(ClientID) = "0" Then
RaiseEvent NoJavascript(Me, EventArgs.Empty)
If NoJavascriptUrl <> String.Empty Then
Response.Redirect(NoJavascriptUrl)
End If
End If
End If
End If
If Request(ClientID) <> String.Empty Then
If Request(ClientID) = "1" Then
Me.Visible = False
End If
End If
End Sub

</script>
<!--

CheckJavascript by Structured Solutions - www.structured-solutions.net

Everything below this comment will be displayed if javascript is not
running in the browser. The message can contain text, HTML, links...
whatever you want.

-->
Some features on the store require javascript. <i>Please enable javascript and
then reload this page.</i>

 Thursday, 03 March 2005
Shipper 1.1 RC3

Shipper 1.1 RC3 (1.1.0.2) is now available.

  • CHANGED: Removed check for update.
  • CHANGED: Shipment groups expanded by default.
  • FIXED: Stores appear in random order.
  • FIXED: Shipment list loses focus.
  • FIXED: Shipments reset after each send/receive.
  • FIXED: Select store changed when print format changed.
  • FIXED: Print format change is sometimes lost.

download | help | release notes

SignIn Control for StoreFront Version 1.3.2

Version 1.3.2 of the SignIn Control is now available. This is a free update for all current owners.

  • FIXED: Cart items with attributes are not restored correctly.

downloadpurchase | help | release notes

 Wednesday, 02 March 2005
SignIn Control for StoreFront Version 1.3.1

Version 1.3.1 of the SignIn Control is now available. This is a free update for all current owners.

  • NEW: RememberMeTimeout and RememberCartTimeout properties let you control how long the cart contents and login information are stored on the computer.
  • FIXED: Page will not load if a licensing error occurs.
  • FIXED: Cart contents are not store by FireFox.
  • FIXED: Property title reverts to generic title when property is saved.
  • FIXED: Cart contents are lost if an error occurs during checkout.
  • FIXED: Cart contents are restored after checkout if checkout on different domain.
  • FIXED: Properties are not shown in alphabetical order.
  • CHANGE: Removed unused Template attributes from sample controls. Template attributes were replaced by configuration values in version 1.3.0.

downloadpurchase | help | release notes

 Saturday, 26 February 2005
Shipping Cost Calculator for BVC2004 1.2.1

Shipping Cost Calculator version 1.2.1 is now available:

  • FIXED: Calculated rates are occasionally incorrect when cart.aspx is first displayed.
  • FIXED: ZIP+4 invalid when GeoMonster service is used.
  • FIXED: Licensing error prevents cart.aspx from being displayed.
  • FIXED: Proposed address (postal code and region) is not carried through to checkout.

download | help | release notes

 Wednesday, 16 February 2005
What does RC mean?

I use RC in the version as shorthand for Release Candidate. A Release Candidate is a version of the software that is almost, but not quite, ready for production release. If I sold copies of the software on CD's, a Release Candidate is not quite ready to send to the duplicators.

A Release Candidate has been tested and there are no known bugs (at least no critical bugs), but I can not test every possible condition (because I don't know what they are). This means there may be unknown bugs, possbily even critcial bugs that will eat your data and spit it back out in little pieces...honestly though, this is not likely.

I make Release Candidate software available while I am still testing obscure issues and editing the final release (i.e. writing documentation and tweaking the installers). Luckily, while I am testing what I know, some brave souls are also downloading the Release Candidate and testing what they know. The end result is much better product. A good example is the address encoding bug that was resolved in Shipper Service 1.1 RC2 for BVC2004. An alert customer let me know that her store had an ampersand in the company name and that BVC2004.5 was storing that value as &amp;amp; (this is a bug...it should be stored as &amp;), and that "&amp;" was being printed on the UPS label. RC2 includes a fix that will decode the address fields no matter how many times they have been encoded so that &amp;amp; is printed as & on the label.

I continue releasing Release Candidates until there are no more bug reports for a week or so. Then I make the final installers, and branch the project for the next release.

Shipper Service 1.1 RC2 for StoreFront Available

I am pleased to announce that Shipper Service 1.1 RC2 for StoreFront is available for download.

  • CHANGED: Minor UI tweaks.

This version can be installed on top of RC1.

Shipper Service 1.1 RC2 for BVC2004 Available

I am pleased to announce that Shipper Service 1.1 RC2 for BVC2004 is available for download.

  • CHANGED: Minor UI tweaks.
  • CHANGED: Order notes are now added when the order is changed by Shipper Service.
  • FIXED: Order status was not changed to Completed.
  • FIXED: Ship To and QVN Notification email address was blank.
  • FIXED: Address fields from BVC 2004.5 have extra layers of encoding (i.e. & is encoded as &amp;amp;).

This version can be installed on top of RC1.

Shiper 1.1 RC2 Available

I am pleased to announce that Shipper 1.1 RC2 is now available for download.

  • NEW: Page header and footer are no longer included in print.
  • CHANGED: Shipper Service file name is no longer required during setup.
  • CHANGED: Faster shutdown when there are many pending shipments.
  • CHANGED: Minor UI tweaks.
  • FIXED: Some phone numbers caused an error during print.
  • FIXED: Occasional invalid "Invoke" during startup.
  • FIXED: Occasional null reference error during print.
  • FIXED: Occasional null reference error if shipment information changed between send/receive.

This version can be installed on top of RC1.

 Friday, 11 February 2005
 Thursday, 10 February 2005
 Tuesday, 08 February 2005
Shipper Service 1.1 RC1 Release Notes

See the announcement and downloads page for more information.

  • Shipper Service 1.1 is now a separate download from Shipper 1.1.
  • Shipper Service 1.1 now works with both StoreFront 6 and BVC 2004.
  • Shipper Service 1.1 for StoreFront 6 supports StoreFront 6.3 or above with either MS Access or SQL Server.
  • Shipper Service 1.1 for BVC 2004 supports BVC 2004.5 or above.
  • Shipper Service 1.0 and Shipper Service 1.1 can be installed at the same time on the same web site. They can even be installed in the same folder...although that might make it difficult to remove.
  • You do not need a separate license file for Shipper Service 1.1 RC1; there is a built-in beta license that expires on 3/31/2005. However, if you have a license for Shipper Service 1.0 it will take precedence.
  • Everyone that is using the beta license will have the same beta serial number. The serial number is used as an encryption key to secure the communication between Shipper 1.1 and Shipper Service 1.1. That means that everyone using the beta license will be able to communicate with all other Shipper Service 1.1 RC1 sites. However, if you leave User Authentication enabled they will not be able to access any data.
Shipper 1.1 RC1 Release Notes

See the announcement and downloads page for more information.

  • Shipper 1.0 and Shipper 1.1 can be installed "side-by-side". This means that you can install Shipper 1.1 on the same computer with Shipper 1.0 without overwriting any Shipper 1.0 files and remove Shipper 1.1 without disabling Shipper 1.0. You do not need a separate license for Shipper 1.1 RC1; there is a built-in beta license that expires on 3/31/2005.
  • UPS WorldShip V7 must be installed prior to installing Shipper 1.1.
  • Shipper 1.1 uses different UPS WorldShip import/export files than Shipper 1.0. To import shipments from Shipper 1.1 to UPS WorldShip, select "From Shipper by Key" or "From Shipper by Order". To export shipments from UPS WorldShip to Shipper 1.1, select "To Shipper".
  • Print formats are now stored in the "Print Formats" folder within the Shipper 1.1 installation directory; typically "My Documents\My Applications\Structured Solutions\Shipper 1.1\Print Formats". Two new print formats are included as samples, and the Structured Solutions logo has been removed from all formats.
  • The help file has not been updated for Shipper 1.1 RC1.
  • Configuration information will be imported from Shipper 1.0; however, since Shipper 1.0 did not include integrated security the information is not complete. Please use Tools->Options->Change to fill in the missing information for each store.

 

Shipper Service 1.1 RC1

Shipper Service 1.1 RC1 is now available for download. I will try to describe all the new features over the next few weeks. The most significant changes include:

  • Integrated Security
  • A Configuration Page
  • Support for both StoreFront and BVC 2004.5

Integrated Security

As I noted in the announcement for Shipper 1.1 RC1, one of the major new features in Shipper is the complete support for drop shippers. That meant that merchants had to have a way to restrict the amount of information that is presented to drop shippers. We don't want one drop shipper accidently getting the shipments meant for another. In order to filter the shipments, we need to know who is asking. To solve that, Shipper Service 1.1 can require a username and password to access the system. This is a separate username and password than the Windows credentials that your host assigned. This means that you can authorize and protect your data without contacting your host.

A Configuration Page

To define users and control what they can access, a new web-based configuration page is now included with Shipper Service 1.1. Using this simple interface, you can add, remove or edit users. Each user can have full access to the shipment data, no access, or anything in between. The most powerful way to use this feature is to create a unique user for each one of your drop shippers. Then you can give them access to your store via Shipper Service 1.1 assured that they can only see and process their own drop shipments.

Support for both StoreFront and BVC 2004.5

Many merchants run several shops using a mix of StoreFront and BVC 2004. Starting with Shipper Service 1.1, you can install Shipper Service on both. Shipper Service 1.1 for BVC 2004 works with BVC 2004.5 and above. Shipper Service 1.1 for StoreFront works with StoreFront 6.3 and above. Shipper 1.1 works with both Shipper Service for BVC 2004 and Shipper Service for StoreFront, so one copy of Shipper can handle all of your stores.

Shipper 1.1 RC1

Shipper 1.1 RC1 is now available for download. There are literally 100's of changes since 1.0.6. I will try to describe all the important new features over the next couple of weeks, for now let me touch on the most significant new features:

  • Support for batch processing in UPS WorldShip V7.
  • Support for drop shippers.
  • Integrated security.

Support for Batch Processing in UPS WorldShip V7

Several new fields are now imported from Shipper to UPS WorldShip to support batch processing. Two of them -- Billing Option and Package Type -- are configured when you setup your store in Shipper. The rest of them make up the "ship from" address. The addresses are now pulled from your store. For shipments that are shipped directly from your store, the ship from address is the store's address. For drop shipments, the ship from address is the vendor's address. Since StoreFront does not provide an interface to edit either the store's or the vendor's complete address, a new feature was added to Shipper so you can edit the addresses from your computer. Try right-clicking on any store icon in Shipper and select Edit Addresses.

Once the shipments have been moved to the UPS Inbox in Shipper they are ready for batch processing in UPS WorldShip. Just select Batch Import from the UPS Online Connect menu. Note that the new import mapping files are named "From Shipper by Key" and "From Shipper by Order". Either one will pull in all the shipments.

Support for Drop Shippers

Shipper 1.0 did not include drop shipments at all. When it came time to add drop shipment support, several issues had to be solved. Among these, two issues really stuck out:

  • How to filter in or filter out specific drop shipments?
  • How to secure the data so one drop shipper does not see shipments for other drop shippers?

Shipper 1.1 solves both of those issues. When you setup your store in Shipper 1.1, you can now select exactly which drop shipments you want to include (by drop shipper name). Furthermore, you can override that choice in Shipper Service 1.1 by username. That means that as the merchant, you can give your drop shippers access to your store via Shipper Service 1.1 and they will only see the shipments that are meant for them.

Integrated Security

Shipper 1.1 now includes an integrated security system that will prevent unauthorized access to your shipment data -- even if you allow anonymous web access. The conversation between Shipper 1.1 and Shipper Service 1.1 can be completely protected with a username and password and the password is never sent in clear text.