RaSor’s Blog

December 18, 2009

ASP post to ASP.NET upgrade and encoding error

Filed under: Debugging, NET, VB6, Visual Studio — rasor @ 7:16 am

I wanted to debug some .NET code from an oldfashioned ASP page. the ASP page called a COM enabled .NET component using Server.CreateObject().
The ASP page received a form posting before the call to the component. 

If I replaced that serverside code with ASPX, then I instead could instanciate the .NET component through a “new MyNamespace.MyComponent()” instead of the “Server.CreateObject()”. By setting the posing ASP form as the startup url like http://mysite/myform.asp, I was then able to set a breakpoint in the new aspx page that received the form posting (myform_actions.aspx). The debugging could nicely continue in the .NET component. 

When you do this trick of upgrading the code for the received form post, there is a few things to consider: 

  • You need to reauthenticate in some way
  • The Session state from ASP is not shared with you ASPX session. You need to recreate any session variables in your ASPX session, if you need to use them in your migrated code.
  • Encoding of the form post needs to be done.

The migration worked fine and the debugging was a releave.
But initially I haven’t set the encoding. 

When the form post entered the myform_actions.aspx I could see (using Fiddler) that a posted “ø” was sent correctly as “%F8″, but it was tranlated to “?”, when read from Request(“MyTextInputCtrl”). 

There were some links telling me about the problem:

http://bytes.com/topic/asp-net/answers/491522-encoding-problem-when-posting-text-between-classic-asp-asp-net
http://www.w3.org/TR/html4/interact/forms.html#adef-accept-charset
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpgenref/html/gngrfGlobalizationSection.asp

The latter link fixed the problem:

<configuration>
   <system.web>
      <globalization
         requestEncoding="iso-8859-1"
         responseEncoding="iso-8859-1"/>
   </system.web>
</configuration>

The accept-charset I did not use. It probably is not understood in a HTTP/1.0 post.

The End.

April 16, 2009

WSS30/MOSS07: SPD07 is now free!

Filed under: Sharepoint, WinApps — rasor @ 5:26 am

November 8, 2008

TFS 2008 test drive

Filed under: Sharepoint, TFS, Visual Studio — rasor @ 8:10 pm

At work I use TFS only for Source Control for .NET source code. Since TFS is much more I will in this post just get started looking a little around… (more…)

November 7, 2008

TFS 2008 inst: Errors

Filed under: Administration, Sharepoint, TFS, Visual Studio — rasor @ 11:23 pm

While trying to install TFS 2008 as in standalone mode on a Win server 2003 several installation prerequisites had to be met: (more…)

October 31, 2008

Visual Studio: Cool keyboard shortcuts

Filed under: NET, Visual Studio — rasor @ 9:53 pm

A few cool Visual Studio 2008 keyboard shortcuts… (more…)

September 19, 2008

Visio: Adding Connection Points to a Shape

Filed under: Apps, WinApps — rasor @ 8:25 am

If you ever used Visio you probably have been using shapes that had to little connection points. You don’t have to live with that:

  • On toolbar select “connection point tool” – it is hiding on the dropdown list of the “connector tool”
  • Optional: zoom to 200% in order to be able to hit a shape
  • Select a shape. => the shape will reveal a dotted line on which you can drop the connection points on
  • Hold down Ctrl while dropping a connection point onto a shape by clicking on the dotted line

August 28, 2008

PC Update to .NET3.5 SP1

Filed under: NET, Visual Studio — rasor @ 9:10 am

I’ve just updated my PC from VS2008 + .NET3.5 to VS2008 SP1 + .NET3.5 SP1. (more…)

February 28, 2008

Gimp tutorial – Modify jpg, add txt

Filed under: WinApps — rasor @ 6:41 pm

Sorry, my Gimp installation was in danish. Wonder where that happened.

Layer 1 I put a jpg photo and modified it a bit

  • Farver – Kurver 
  • Filtre – Blødgøring – Selective Gausian blur…
  • (Filtre – Forvrængning – Lens Distortion)

Now some txt should be added 

  • Udviddelser – Logos – Cool Metal – Font: Century Gothic Bold, Size: 50
  • Write: UltraRunning – OK => generates some nice txt
  • Ctrl + L (show layer window)
  • Unselect (click on eye) all layers except the txt layer
  • Txt: R (Rektangulær markering) – Select the txt by drag’n'drop
  • Txt: Redigér – Kopiér synlig
  • Photo: Lag – Nyt lag – Write: “Txt”
  • Ctrl + L (show layer window)
  • Unselect (click on eye) all layers except the Txt layer
  • Photo: Redigér – Indsæt i
  • Photo: R – Select hele billedet, som er rammen hvori txten kan flyttes i synligt
  • Photo: M (Move) – Tryk på txten og flyt den det ønskede sted hen.

December 19, 2007

Examples: Replacing Text

Filed under: TextPad — rasor @ 7:00 am

These examples all use UNIX extended regular expression syntax.

(more…)

Examples – Finding Text

Filed under: TextPad — rasor @ 6:58 am

These examples all use UNIX extended regular expression syntax.

(more…)

Blog at WordPress.com.