views:

354

answers:

2

So I have a flashobject which I need to pass a formatted DateTime string to.

My code:

string date = DateTime.Now.ToString("yyyy-MM-dd HH:mm:ss");

which outputs as: 2009-09-16 22:26:45

However when it is actually output to HTML and swfobject it renders it as:

so.addVariable("inNowDate","2009-09-16+22%3a25%3a13");

I think this is messing up a calculation that the flash object does based off the current time. Do I need to encode or decode this?

Any help would be greatly appreciated! Thanks!

+1  A: 

It's not that you have gained special characters, but rather certain special characters you already had are now URL encoded.

There's not enough information present for me to see exactly where this URL encoding his happening. Can you post a bit more context?

Eric J.
I think the problem is i'm using a flash control called BeWise. I add the variables to it and I'm guessing it's doing the encoding. I've tried to UrlDecode in my codebehind but they still output like this.
Jack Marchetti
A: 

When you output to html, try using UrlDecode.

http://msdn.microsoft.com/en-us/library/6196h3wt.aspx

Steve
tried URL decode. I'm wondering if the control i'm adding the variables too is doing the decoding.
Jack Marchetti
Perhaps the function has a decode option? e.g. so.AddVariable(x, "2000...", true)? Or check anywhere in the api of the swfobject for a decode option.
Steve