October 7, 2010

Solution for ASPDotNetStorefront v9 when banning a Customer’s IP address

Filed under: Tips — Tags: — Webopius @ 9:56 pm

I haven’t posted for a while, so I’ll start things rolling again with a nice simple fix for any ASPDotNetStorefront (ASPDNSF) users experiencing this issue.

Blocking your own IP Address out of the site

In ASPDotNetStorefront v9, when you are editing a Customer as a site administrator and you click the ‘Ban this IP address’ button, we’ve sometimes found that the site will ban YOUR IP address rather than the Customer you are editing. This can leave you in a tricky situation where you are unable to log into your own site unless you un-ban yourself using the database.

Quick fix for the Ban this IP address issue

If your site is experiencing this issue, there’s a very quick fix that worked for us:

– Edit the file ‘editcustomer.ascx.cs’ within your site’s admin \Controls directory
– At about line 400, look for this line of code:


DB.ExecuteSQL("exec [dbo].[aspdnsf_insRestrictedIP] @IPAddress=" + DB.SQuote(ThisCustomer.LastIPAddress), conn);

– Change this line to:


DB.ExecuteSQL("exec [dbo].[aspdnsf_insRestrictedIP] @IPAddress=" + DB.SQuote(m_TargetCustomer.LastIPAddress), conn);

That’s it!

  • Tags