Archive for November, 2007

What is the quickest way to send binary data from a web service?

November 27, 2007

If the file is <100mb use a byte array property on a struct or a class.

If the file is >=100mb use MTOM. The caveat, and there always is one, that MTOM only provides stream based access on files being downloaded from the web server and not those being uploaded.. (Yeah, sucks)

-Dave

How can I open the stellent viewer in an iFrame?

November 26, 2007

string.Format(“{0}/IBPMWebWIS/?ToolName=AWVWR&Viewer={1}&LUCID={2}&MIMETYPE={3}&TABLENAME={4}&ROWIDENTIFIER={2}&EOF=1″, host, encodeURIComponent(typ), encodeURIComponent(LucID), encodeURIComponent(MimeType), encodeURIComponent(TableName));

Yeah, I know, I’m this kewl [no seriously, go Google it, this is the ONLY refernce on the web.. nice eh?]

How do I encode an URL /HTML / Text in .NET?

November 26, 2007

Server.HtmlEncode(strValue); is the answer.. Unless..

You want to call it from a static method (and we always do… ;)

We have two main options:

System.Web.HttpContext.Current.Server.HtmlEncode(s trValue);

And thenĀ  System.Web.HttpUtility.HtmlEncode (my preferred method..) Why?

Because it also has methods to encode Url’s and you can get the data as a string, or byte array (nice for marshalling or persisting to a data store.. )

Ever wanted to reduce/consolidate the number of <@ Register statements in your web pages?

November 6, 2007

Funny FedEx commercial..

November 2, 2007

Americans do so know Geography.. Uh Huh!

Click Here