« Posts under Development

Keep ASPX Session Alive Using machineKey in Web.config

You may have noticed that when your ASP.NET pages are running in a hosted environment, there are issues with preserving and parsing postbacks.

An ASP.NET application is not particularly well-equipped for handling postbacks on hosted servers out of the box.  The reason for this is that postbacks (and ViewState) normally get encrypted (hashed) so that they cannot be tampered with on the way back to the server.

The keys used to encrypt the information stored in ViewState are supplied by the configuration files.  Say hello to decryptionKey and validationKey.

Just as all other configuration properties, system.web.machineKey is normally specified in Machine.config, which—as its name implies—is unique to every machine.  You do not have to provide your own hashing codes – they are supplied (randomized) by the IIS installer. »Read More

How to Make a Lightweight Twitter Share Button

The original Twitter button is nice and useful.  It has one major disadvantage though – it comes as an IFRAME, bringing with itself an entire HTML document with JavaScript, etc.  This means that when you embed a Twitter button onto your page, you cause the load times to soar, and your visitors will have to download plenty of overhead data just to show one simple button. Even worse, visitors with disabled JavaScript (or a simpler mobile browser) will not see anything.

In this post, I will show you how to make a Twitter share button (or a ‘tweet button’) that looks exactly like the original, loads lightning-fast and does not query any server but yours.

»Read More

Special Characters in Web Jump Lists (IE9+Windows 7)

Scribz.net™ has been using Internet Explorer 9′s Pinned Site capabilities for a long time, especially the Jump List features.  And why not – they are so easy to implement and quite well-documented (see the Jump List documentation on MSDN).  The basic functionality can be achieved by adding but a few meta-tags into the head of your page and you’re set.  It actually takes more time to stitch together the page icons than to make your site IE9 ready.

Basic Setup

The following meta tags set the basic icon and text properties of your pinned site:

<meta name="application-name" content="Example Web Application"/>
<meta name="msapplication-tooltip" content="Start Example.com in Site Mode"/>
<meta name="msapplication-starturl" content=http://example.com/index.html/>
<meta name="msapplication-window" content="width=800;height=600"/>
<meta name="msapplication-navbutton-color" content="#77FF33"/>

You can read about the details for each item in the MSDN article linked above.  Also please note that the msapplication-tooltip only shows when the user hovers over your application’s icon in the Start menu.  I haven’t ever seen it pop up above the pinned Taskbar icon.

You can easily input any Unicode and international characters into the application-name and msapplication-tooltip content attribute by using HTML entities.  Will this work for the msapplication-task meta tag, though?

»Read More

The Initial Design 1: The Visuals

Once I was sure that my own online notepad, I was wondering where to start – do I begin with the architecture of the application, or do I start with the visuals and layout?

To be frank, this wasn’t as straightforward a decision as one would hope.

Normally, starting with the information workflow and application structure is the best idea.  Granted that you know exactly what you are going to produce, of course.

In this case, I decided to take the artist’s approach to the task; some may call it behavioral.  Scribz.net™ was going to be a very simple application after all (at least initially) so I figured that starting with the visuals might help me decide which features I would want to include and in what order.  I thought that I could devise my application structure based on the logic of the usability.  I was sure I could code (implement) almost anything related to this application, so I felt that a reversed approach might be justified this time.  How cool that the simplicity and power of Scribz.net™ was already proving at such an early stage!

Thinking Visually

Drawing different mock-ups of the visuals was quite fun.  I ended up with several napkins and torn college block pages scribbled all around with notes, random arrows, and tiny bits of explanations.  I did most of my drawing by hand, with virtually no computer help.  I though I should mention that.

»Read More

The Skills

Market Research

As I mentioned before, I needed a .  I did some initial research to find out whether there was a similar application out there.  I came across a few online notepads, but most of them supported rich-text or HTML formatting.  If I wanted that, I thought to myself, I would have gone to Google Docs, or Microsoft Web Apps.  I didn’t care for fancy, I just needed speed, reliability, and universal accessibility.  Obviously, the rich apps were not the way to go and were not my competition either.  Phew!

The closest to an online notepad was Google’s Notebook app.  Whereas it is made of the nice, familiar Google interface, it is a little bulky and you have to be logged into the same Google account to which your notes belong.  Yeah, there is sharing, but why worry about that?  Also, it is not exactly plain text either and is not even supported anymore, as far as I’m aware.  Worst of all, it auto-formats links and has this weird separation of bookmarks and note content.  All in all, seemed like a poor choice as well.

Never mind, it was going to be my way or the highway, which usually turns out to be my highway.  Or at least my sidewalk.

So I asked myself – could I do this?

My Abilities

Before I could start with any coding, I had to sit down and try to wrap my mind around the entire idea.  I had to know what I was about to do and I had to know whether I was actually going to be able to do it.  In other words, I first tried to remember all I knew about programming already:

»Read More

The Story of Unicode Byte Order Mark (BOM)

… or Windows Live Writer 2011 & WordPress

I was frustrated.  I was completely disappointed and ready to give up trying to set up Windows Live Writer to work with my  freshly established Scribz.net™ WordPress Blog.  I kept receiving the following error from my newly installed Windows Live Writer upon sign-up to my WordPress:

The response to blogger.getUsersBlogs method received from the blog server was invalid, something-something XmlRpc something-fail-something…

And the following error appeared in the Windows Live Writer log:

Invalid response document returned from XmlRpc server —> System.Xml.XmlException: Unexpected end of file while parsing Name has occurred.

My native WordPress online user interface worked just fine.  It seemed that there was a problem just with Windows Live Writer 2011 and its connection to the XmlRpc interface.  I spent countless hours trying to figure out what was wrong almost until the point of no return.  Just as I was going to give up on the issue, however, the sleepless night paid off and I managed to find the unlikely culprit.  Now that I wiped the floor with it, I am writing this post from Windows Live Writer.

The Cause

So I set up a fresh new subdomain on a Microsoft IIS 7.0 server at my hosting company.  I downloaded the latest version of WordPress, unzipped it and copied it verbatim to my FTP server.  I was excited because this was going to be my first real attempt at blogging.

»Read More