WordPress file upload size HTTP 404 error greater than 1mb IIS 7.5

A default install of Server 2008 with IIS 7.5 will force Request Filtering to 1000000 bytes.   That’s 1mb.

So a non asp.net website (i.e. PHP only) will always be limited to 1mb upload size.

This assumes you’ve already updated your PHP.ini with the appropriate size limits as widely documented on the internet.

To fix this, click on your website in IIS Manager.  In the IIS section of the website, double-click Request Filtering.

Now, on the right side click Edit Feature Settings.   There you will find the default limit of 1mb (in bytes), change it to something larger.   Restart the site.

Cisco VPN Client: Unable to Enable Virtual Adapter Error 442

On my Windows 7 PC, I could not get the VPN client to connect even when the configuration was correct.

I eventually found a post online that said to stop the Internet Connection Sharing service before initiating the VPN connection.  This solved my problem and I was able to connect without any errors.

How to Add Login-as-User button to Edit User Page in AbleCommerce 7

Introduction

This modification is so simple to do, yet so useful once you do it.  How many times have you had to look up a user account, edit their account to view some detail and then decide you need to log in as that user?  Or even worse, create a brand new user account and immediately need to log in as that user?

Well for me it happens a lot.  I often view a user’s order history before deciding my next action.  The easiest way to do that (for me) is to search for the user in Admin/People/Users and then hit the Orders tab.  But the problem is once you’ve edited the user, there’s no way to log in as that user.  You have to hit the back button and do it from the main User Search page.

What’s worse is if you want to do it for a brand new user.  There’s no easy way to log in as that newly created user after creating the new account.  You have to return the User Search page, re-enter the email address again, search and finally hit the Login icon button.  YAWN!  Smile

Wouldn’t it be handy to be able to log in as that user account right from the Edit User page?

This modification will add a nifty little Login-As-User button to the top of your Edit User page.  It’s at the top for a reason – that way it’s always available no matter what tab you’re viewing.

Code Changes

FIrst you need to find your /Admin/People/Users/EditUser.aspx file and edit it with your favorite text editor.  In the file, find this code near the top:

<div class="pageHeader">

    <div class="caption">

        <h1><asp:Localize ID="Caption" runat="server" Text="Edit User: {0}"></asp:Localize></h1>

    </div>

</div>

Once you find this section of code, replace it with this new code:

<div class="pageHeader">

    <div class="caption">

        <h1><asp:Localize ID="Caption" runat="server" Text="Edit User: {0}"></asp:Localize>  <asp:Button ID="btn_LoginUser" runat="server" Text="Login As User" AlternateText="Login as User" ToolTip="Login As User" OnClick="btn_LoginUser_Click"/></h1>

    </div>

</div>

 

Save the file once the changes are made.  The change you just made adds the button to the page.  However we still need some logic on the programming side so the server knows what to do when the button is clicked.

To add the programming logic, edit your /Admin/People/Users/EditUser.aspx.cs file with your favorite text editor.  Find this section of code at the very top:

using CommerceBuilder.Utility;

 

and change it to look like this:

using CommerceBuilder.Utility;

// BEGIN MOD:  AbleMods.com

// 7/20/2011

using System.Web.Security;

// END MOD: AbleMods.com

 

Now move further down the file and find this code:

protected void ShowHideDisabledAlert() 

{

    if (IsDisabled.Checked)

        IsDisabled.Text = "This account is disabled.";

    else

        IsDisabled.Text = string.Empty;

}

And replace it with this:

protected void ShowHideDisabledAlert() 

{

    if (IsDisabled.Checked)

        IsDisabled.Text = "This account is disabled.";

    else

        IsDisabled.Text = string.Empty;

}

 

// BEGIN MOD:  AbleMods.com

// 7/20/2011

protected void btn_LoginUser_Click(object sender, EventArgs e)

{

    FormsAuthentication.SetAuthCookie(_User.UserName, false);

    Response.Redirect(NavigationHelper.GetHomeUrl());

}

 

// END MOD: AbleMods.com

Save the changes once you are done.

Testing

The next step in ANY programming change is to test your changes.  So fire up your AbleCommerce store, log into your Admin side and select the People/Users menu option. 

Once you’re on the User Search page, edit an existing user or add a new user account to reach the Edit User page.  Once the Edit User page is displayed, you should see your new button in the caption directly above the tabs.  Click it and see how it works.

Conclusion

Adding nifty little buttons like this one can make your daily work go so much smoother.  Browser-based applications have long been a hassle because of all the additional mouse clicks necessary.   By modifying your AbleCommerce Edit User page to have a new button for Login-As-User, you’ve saved yourself time and stress by simplifying your workload. 

Visual Studio 2010 Macros vsaenv cannot find one or more components error

This week has been nothing but hassles after upgrading to Visual Studio 2010 Professional. 

After a few days running VS2010, I was happy with the installation so I decided to uninstall Visual Studio 2008 from my computer.  The uninstall went fine and I even bounced my PC just to be on the safe side.

At first Studio 2010 seemed completely unaffected by the uninstall of VS2008, but boy was I wrong.  As soon as I tried to fire off a recorded macro VS2010 just sits there like it’s going to hang.  Eventually I noticed a background popup box in the taskbar.  I switched to it and saw that VS2010 was complaining “cannot find one or more components…” blah blah blah.

Closing the popup had a 50/50 chance of completely blowing up the VS2010 IDE.  Joy.

I even tried doing a Repair from the installation setup.  No luck.

After researching this morning, I found the cause.  I have copied both it and the solution below.  In my situation, this resolved it perfectly and I didn’t even have to reboot.

2.1.7 On computers on which Visual Studio 2008 or SQL Server 2008 is installed and Visual Studio 2010 has been uninstalled and then reinstalled, using the Visual Studio Macros IDE may cause Visual Studio to crash

Uninstalling Visual Studio 2010 also removes the Visual Studio Macro Tools package. If the computer also has Visual Studio 2008 or SQL Server 2008, then reinstalling Visual Studio 2010 does not reinstall the Visual Studio Macro Tools package. This causes an error when the Macros IDE is started, and Visual Studio crashes if you try to recreate the MyMacros.vsmacros project.

To resolve this issue:

  1. Delete the following file:
    1. On a 64-bit operating system: "%ProgramFiles(x86)%\Microsoft Visual Studio 9.0\Common7\IDE\1033\Microsoft.VSDesignerUI.dll"
    2. On a 32-bit operating system: "%ProgramFiles%\Microsoft Visual Studio 9.0\Common7\IDE\1033\Microsoft.VSDesignerUI.dll
  2. On the Add or Remove programs page, select Uninstall/Change Visual Studio 2010 and then click Next.
  3. Select Add or Remove features.
  4. Clear and then re-select any of the features in the list. This causes the update state to be enabled.
  5. Finish the Setup wizard. Visual Studio Macro Tools should be installed.

AbleCommerce 7 Build Web Site with Visual Studio 2010

Having problems building your AbleCommerce 7 website with VS2010?  So am I.

So far I’ve figured out that even though you have your IIS application pool set to .Net 2.0, you still have to set the Target Framework in VS2010 to .Net 4.0.    Otherwise VS2010 won’t build the AC7 site.

Not sure why, but if you don’t do it that way, VS2010 will complain about ScriptManager and/or UpdatePanel (the AJAX stuff) and your site won’t build.

Sure would be nice to spend time programming instead of fighting VS2010.  Upgrading to Visual Studio 2010 may not have been my best move of the week Sad smile

ASP.Net error ScriptManager does not exist in the current context

I just recently upgraded to Visual Studio 2010.  After trying to build the site for the first time (in VS2010 that is), I got an unusual error message.

For some reason, VS2010 didn’t like this code any more when VS2008 was ok with it:

ScriptManager.RegisterClientScriptBlock(page, typeof(string), "EditHTML", js, true);

Visual Studio 2010 was complaining that ScriptManager does not exist in the current context.  Yet it compiled fine in 2008 Studio.

After a little searching on the net, I found a conversation about having to add a reference to System.Web.Extensions to the project.  Doing this resolved the problem for me.

So technically, VS 2010 was right – it didn’t exist in the current context Smile

FogBugz and Beanstalk integration setup

Yesterday I decided it was time to tie my case management software FogBugz into my source code control system Beanstalk (SVN).

Beanstalk offers a FogBugz integration, but I couldn’t get it to work.  Every time I set it to my FogBugz URL, Beanstalk would respond with some sort of “Unable to connect to host” message.

The solution was that the Beanstalk integration to FogBugz does not support sub-domain URLs for the FogBugz path.  In other words, you can’t do http:// www. ablemods. com/ support/.  However, if you move your FogBugz path to the root of a site URL like http://support.ablemods.com/ then the integration works flawlessly.

FogBugz has a nice instruction page that details how to move the install from a sub-domain URL (subdirectory) to a root web site URL.  The instructions are located here:  http://fogbugz.stackexchange.com/questions/6722/moving-self-hosted-fogbugz-and-kiln-from-fogbugz-to

FogBugz technical support was fantastic.  Quick and informative responses really make your day Smile

Finally–decent code formatting for my Blog

After realizing my blog was painful to read when any source code was added, I took a few hours this morning to play around.

First step was getting Windows Live Writer – that made a world of difference with regular posts.  However this didn’t really solve the problem of code formatting.  Next stop:  Plug-ins for WLW.

I tried the first one listed with the most downloads on the plug-in website.  While this one worked, it didn’t really handle long lines by embedding them in a scrolling container.  So, back to the drawing board.

The second most downloaded code formatter (Code Snippet plugin for Windows Live Writer) did exactly what I wanted.  AHA!  Finally I’ll make it work the way I like.  So after installing and testing, my blog looked WORSE.

Finally I found the problem.  There’s a setting in BlogEngine.Net 2.x that specifically controls how blog category entries are displayed.  It was not showing the full HTML for posts when I clicked a specific category.  To fix this, just go into Settings/Basic in the Dashboard and uncheck both checkboxes here:

image

Now when you click a blog category, the blog posts show as they should.