Thursday, May 17, 2007

Aspdotnetstorefront Menu

ASPDNSF uses a 3rd-party component for their navigation menus, Component Art. I've had some fun and exciting times customizing this menu. I would put styles, such as color and font, in the css classes TopMenuGroup and TopMenuItem, and the styles weren't sticking. Sooo frustrating! So using my IE DOM explorer, I highlighted the element (Find -> Select Element by Click) and examined the style, and found my target element to be wrapped in , which was elminating my css class assigned in the .

Here it is interesting to note that this menu is built on the fly, and you as a developer do not get to play with how this menu is created at runtime. I did some research on the NOBR tag and learned it was not css-friendly, but I took a leap of faith and added this to my stylesheet:

.TopMenuItem, .TopMenuItem NOBR, .TopMenuItemHover NOBR
{
background: #443A23;
color: #fff;
}

And voila! My css-styles were now applied.

I'm still struggling with the fact that the marriage between ASPDNSF and Component Arts is not flexible. If you decide to take your top categories horizontally across the top of the screen, you end up having to hard code your menu values in the menuData.xml file and you lose your tie to the category admin component. What this means is that if you change the name of the category, or add a new category, or make a category unpublished, these changes will not be reflected on the front end until you manually modify the xml data file. What a pain. If anyone has gotten around this little feature, I would give you a homemade chocolate chip cookie.

Tuesday, May 15, 2007

IE Developer Toolbar

If you are designing forward-facing web sites using the CSS-box model layout, an essential tool for how your model is behaving is the IE Dev toolbar (get it here: http://tinyurl.com/2ddezw). I also check my sites in Firefox which also has a handy tool for developers (get it here: http://tinyurl.com/2z4tvg). These tools are invaluable when you have to design pixel by pixel to make things perfect.

And because I've used it in my post, I might as well tell you about TinyUrl. My developer-in-arms Pablo showed me this site and I use it all the time. If you have a horribly long URL, especially the encrypted versions, and you want to send a link to your peeps (or to your mother), then use this page: http://www.tinyurl.com. We've found that even Microsoft is using this tool in their MSDN pages :)

Monday, April 30, 2007

.Net web config error

If you get an error that looks like this: Could not load type 'System.Web.UI.Compatibility.CompareValidator' from assembly 'System.Web.Extensions, Version=1.0.61025.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35'. Don't spend too much time looking at your code for this, it appears to be a bug in the webconfig. Simply delete the validators from the webconfig.

The lines will look like this:

comment them out or remove them entirely and you're good to go.

The best bet when you get a strange webconfig error is to copy the entire text of the error and google it. That's the fastest way I've found to resolve runtime issues.

Thursday, April 26, 2007

Quick SQL

I'm almost embarrassed to admit this, I didn't know how to escape a quote (') in a sql string when doing an insert, 'hors d'ouvres'. My only consolation was that my hunch was right, double up the single quote within the string: 'hors d''ouvres'. Just like c#...love it!

Tuesday, April 24, 2007

Publish in VisStudio 2005

I'm a reluctant fan of the publish feature in VS 2005. It isn't easily tinkered with, at least not for me, and it forces a wholesale replacement of the website, including non-compiled pages (javascript, css, images, etc), which takes up too much time in my opinion, in addition to bringing over my development webconfig which is never the webconfig on a staging or production server.

So, a little trick I've come up with is to publish locally and then do a copy of only the bin directory and all ascx and aspx pages. For example, if I have a website under wwwroot (I know it's not necessary with VS2005, but i'm old-fashioned) called MySite, I will have a sister directory called MySite_Build. I publish to this directory and then copy to my remote servers.

When you publish, you have the option of local IIS and the file system. I would prefer local IIS because the path is simpler, but I find I get this error often:
"You must choose a publish location that is not a sub-folder of the source website." This error is confusing because the build directory is NOT a subdirectory and is in no way related to the source website. I haven't figured this out, when I get this error, I simply use the file system to identify the same directory and it works like magic. Go figure.

We'll be moving to the 3.0 framework pretty soon, but we'll still be working in vs2005 for awhile to come, so if anyone has any publishing tips, I can certainly use them!

Thursday, April 19, 2007

ADP Taxware Web API integration

This is just a short note about a gotcha I keep encountering with ADP taxware and then I neglect to document it, and it bites me in the a**. So here I am sharing my pain with the world (i should get a cookie).

ADP Taxware is a program that runs on a server. We have it running on our webserver with our website; currently our load allows this configuration. When the website calls the Taxware API, it needs access to the \program files\taxware directory. You MUST allow the internet anonymous account access to this directory or you will get an obscure error message, and stepping through the code will reveal it to be a permission denied error.

The only other quick advice I have to offer is make sure you copy your dlls to the system32 folder on your server; just residing in the taxware folder (where the install puts them) doesn't seem to be sufficient.

Finally, although Taxware's documentation is cumbersome, their tech support guy on this API is fantastic, his name is Jonathan Wang. Happy coding!

Wednesday, April 18, 2007

Aspdotnetstorefront Out-of-the-box Build Error

My company has begun offering an ecommerce solution to small-to-medium businesses called Aspdotnetstorefront. On behalf of our client, I purchased and download the product and installed it in my wwwroot directory. I made no changes to any files, I simply clicked on the sln file and loaded the solution into Visual Studio 2005 Team Edition.

Before I did anything else, I tried to build the solution. I was unsuccessful, and of course, seriously perturbed...I may have said unfriendly things...so I sent an email off to tech support with a copy of the error.

I received a quick response (you gotta love responsive tech support) and they noted that I seemed to be referencing a file that should not be in that build. How could that happen? I looked in the directory, no file. Mysterious, eh? So I loaded the solution and looked in the directory, there was a file. Odd. So I looked at the path of the file, and it was a path to a storefront directory for a different storefront solution. Problem solved? almost.

I deleted all my files, extracted the download to my newly clean directory, and before I did anything with Visual Studio, I opened the sln file in text editor and modified all the paths in the solution to point to my correct directory. You will have this problem if you try to run more than one storefront solution side-by-side. I saved the sln file. Opened my project, all problems solved. To be safe, I renamed my sln and suo files to match my directory name.

I'm fairly new to this storefront thing, so if you have any tips to share, i'm all ears.