How To Fix Archives - Page 7 of 12 - Digital Tool Factory blog How To Fix Archives - Page 7 of 12 - Digital Tool Factory blog

The Digital Tool Factory Blog

How to fix alignment problems in IE 9

The Problem

You have a beautiful, syntactically valid piece of html that SHOULD be aligned center in all browsers, and is aligned center in FireFox and Chrome, but refuses to align center in IE 9.

The Cause

I encountered this when I built the WordPress theme for this very blog.  The cause of alignment problems in IE 9 is that IE 9 wants to render the page in “Quirks” mode, even if the doctype is valid.  I’m sure there is a reason,  but the solution is so simple, who really cares?

The Solution

Just add the following bit of code into the system

<meta http-equiv=”X-UA-Compatible” content=”IE=9″ >

And quirks mode is gone!  The alignment problems in IE 9 are gone! It will now render properly in a modern format.


31
Jan 12


Written By Steve French

 

The how to fix series

I’ve done this elsewhere – but I’m going to start documenting any odd technical problems that take me more than 15 minutes to solve, largely so I have a reference when I have the same problem again.  Everything will be in a  “The Problem, The Cause, The Solution” format. There will be many posts in the how to fix series I assure you.


30
Jan 12


Written By Steve French

 

How to fix problems with the X-Axis in Microsoft Charting Components

The Problem: You’re creating a line or area chart using the Microsoft Charting components (the ones in System.Web.UI.DataVisualization.Charting, not System.Web.Helpers) and for whatever reason the first entry is actually in the second quadrant, like so:

The Cause: The charting components assume you want to show some sort of contrast for the first value, but it just doesn’t look right in this case.

The Solution: Set your minimum value to 1 instead of zero (zero is the default), like so

myChart.ChartAreas[0].AxisX.Minimum = 1;

The chart will now be pushed flush left, for a much better appearance.  You will see something like the chart below.

 

This post originally appeared on the Stronico blog – with the absorption of Stronico into Digital Tool Factory this post has been moved to the Digital Tool Factory blog


01
Sep 11


Written By Steve French

 

How to fix problems with asp.net, C# and Request.ServerVariables[“HTTP_REFERER”]

The Problem: I recently built a small web app that tracked downloads.   Part of that was using the referring page.  Somehow, for some reason, the url was not being sent along with the request.

The Cause: After much travail, I finally noticed that the browser was on page https://www.somedomain.com and the link in question was http://somedomain.com/mytrackingapp – i.e. not under SSL, and with a slightly different hostname.  For some reason the referer header is not sent in that situation.

The Solution: Just change the link to https://www.somedomain.com/mytrackingapp and life is good.

 

This post originally appeared on the Stronico blog – with the absorption of Stronico into Digital Tool Factory this post has been moved to the Digital Tool Factory blog

 

This post originally appeared on the Stronico blog – with the absorption of Stronico into Digital Tool Factory this post has been moved to the Digital Tool Factory blog


12
Aug 11


Written By Steve French

 

How to fix problems with Coded User Interface Tests

The Problem:

You attempt to create a new Coded User Interface Test in Visual Studio 2010, and you get the following error:

The following package failed to load: C:Users[File Path Goes Here]Microsoft.VisualStudio.TestTools.UITest.Extension.IE.dll. Coded UI Test is now in an inconsistent state. Remove this package and restart Visual Studio to work with Coded UI Test.

The Cause:

For whatever reason, Visual Studio does not copy Microsoft.VisualStudio.TestTools.UITest.Extension.IE.dll into the solution, and but it thinks it did.

The Solution:

Just copy the file over yourself.  Here’s how.

  1. Close Visual Studio
  2. Go to C:Program Files (x86)Microsoft Visual Studio 10.0Common7IDEPrivateAssemblies
  3. Copy the Microsoft.VisualStudio.TestTools.UITest.Extension.IE.dll file into the bin/debug directory
  4. Restart Visual Studio and try again.

No idea on the root cause, but that should fix the problem.

 

This post originally appeared on the Stronico blog – with the absorption of Stronico into Digital Tool Factory this post has been moved to the Digital Tool Factory blog


11
Jul 11


Written By Steve French

 

How to fix problems with Linq and the Entity Framework

database 2

The Problem:

You attempt to do a query using Linq To Entities and your code does not work.

The Cause:

For reasons unknown, Linq to Entities has different operators than Linq To Sql.

The Solution:

Call your initial query/pull and us .ToList() on it before you run any of the problem operators – this fixes the problem entirely.
I am embarrassed to say that I spent 30 minutes trying to get Linq to Entities to work directly before I thought of that.

Creative Commons License photo credit: Tim Morgan

 

This post originally appeared on the Stronico blog – with the absorption of Stronico into Digital Tool Factory this post has been moved to the Digital Tool Factory blog


24
Jun 11


Written By Steve French

 

How to fix problems uploading images in asp.net mvc 3/razor

The Problem: You are attempting to create create an asp.net mvc 3 page with razor that uses an upload control.  You try to upload an image and all you get is a “server not available” error.  Not very descriptive it it?

The Cause: ASP.net sets the default upload limit very low.

The Solution: Raise the limit, just add this to the web.config file ,

<httpRuntime maxRequestLength=”9097151″ executionTimeout=”3600″/>

That’s it!

 

This post originally appeared on the Stronico blog – with the absorption of Stronico into Digital Tool Factory this post has been moved to the Digital Tool Factory blog


13
Jun 11


Written By Steve French

 

How to Fix the “Service Unavailable” problem in IIS

Gears gears cogs bits n piecesThe Problem: For whatever reason, your website is displaying a white screen with “Service Unavailable” and nothing else.

The Cause: There could be many causes, but the one I just discovered was that the application pool had shut down for no good reason.

The Solution: In IIS, navigate to “Application Pools”, right click to bring up the content manager – select “Stop”, and then select “Start”.  That should fix the problem in most cases.

Creative Commons License photo credit: Elsie esq.

 

This post originally appeared on the Stronico blog – with the absorption of Stronico into Digital Tool Factory this post has been moved to the Digital Tool Factory blog


23
May 11


Written By Steve French

 

How to create a asp.net gridview hyperlink field with multiple querystring parameters

Frozen linksThe Problem: You need to put a relatively complicated link (i.e. the link has more than one parameter) into an asp.net gridview column.

The Cause: No cause really, you just need to know the exact syntax
The Solution:

<asp:HyperLinkField HeaderText=””

Text=”Download Your File”

DataNavigateUrlFields=”CategoryID,FileID”

DataNavigateUrlFormatString=”FileDownloader.

aspx?catid={0}&file={1}” />

You can have as many fields as you like in the DataNavigateUrlFields tag, and it will simply autopopulate from that point on (provided you have the parameters in proper {0} fashion.  This is hardly the biggest problem I’ve ever faced, but I didn’t know how to create the Hyperlink field in that way and now I do.
Creative Commons License photo credit: skedonk

 

This post originally appeared on the Stronico blog – with the absorption of Stronico into Digital Tool Factory this post has been moved to the Digital Tool Factory blog


19
May 11


Written By Steve French

 

How to fix problems with asp.net mvc 3 charts and razor pages

The Problem: You attempt to use the super-cool new charting features in asp.net mvc 3, and all you get is compilation errors

The Cause: You are using the old school System.Web.UI.DataVisualization.Charting.Chart namespace

The Solution: Delete

using System.Web.UI.DataVisualization.Charting.Chart

and instead insert

using System.Web.Helpers;

If you are using the chart code in an actual razor page (and not in the controller), just insert

@using RazorHelpers.Helpers

into the top of the page

 

This post originally appeared on the Stronico blog – with the absorption of Stronico into Digital Tool Factory this post has been moved to the Digital Tool Factory blog


06
May 11


Written By Steve French

 




Copyright 2011 Digital Tool Factory. All Rights Reserved. Powered by raw technical talent. And in this case, WordPress.