How to use an iFrame and set the URL in Server Side C#

May 16, 2008 by axostech

//Here is the HTML for the IFrame:

<iframe runat=”server” id=”ifStellentViewer” width=”100%” height=”450px”></iframe>

//Here is the server side event code:

if (_iFrameTarget != null)
{
_iFrameTarget.Attributes["src"] = sHTTP_URL; //eg: http://www.yahoo.com
}

//Here is the object defintion in case you need to cast it:

private HtmlGenericControl _iFrameTarget;

public HtmlGenericControl TargetFrame
{
get
{
return _iFrameTarget;
}
set
{
_iFrameTarget = value;
}
}

//Then we just set the iframe as a referece like:

UcStellentTree1.TargetFrame = ifStellentViewer;

Some nice tools :D (Courtesy Stephan..)

March 10, 2008 by axostech

“The project file ‘ ‘ has been renamed or is no longer in the solution”

December 19, 2007 by axostech
This can cause you to go postal..
Thanks to ” Michiel van Otegem  ” for the solution..

– Original Article Begins –

We were recently faced with the error message The project file ‘ ‘ has been renamed or is no longer in the solution in Visual Studio 2005. The problem is that from this message you have no idea what is actually the matter. We finally figured out that this happens when a Web Project contains references to assemblies or projects it can’t find. Here’s how you solve this:

  1. Right click the Web project and select Property Pages.
  2. A window will open which lists all the references, either to the bin-folder, GAC or other projects in the solution.
  3. Remove those that show (unavailable) behind it.
  4. Chances are that now you can’t build because the reference is not there. Simply add the reference again and you should be OK.

– Original Article Ends

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

November 27, 2007 by axostech

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 by axostech

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 by axostech

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 by axostech

Funny FedEx commercial..

November 2, 2007 by axostech

Americans do so know Geography.. Uh Huh!

Click Here

What the Dell?

October 29, 2007 by axostech

I was trying to restore a Dell PC for a friend.. (Not to self.. don’t ;) and it turns out that on a Dell PC with Norton GoBACK installed that the normal System Restore key (CTRL + F11 at boot time) don’t work, and are over ridden. you MUST use them to get GoBACK open, and then DISABLE GoBACK. Reboot (after waiting 30 minutes for it to clean up from itself) and then you can use the sequence to start the Dell PC Restore. Click on Restore and Confirm and you should be all set..

BTW you just ERASED all of the data, programs and settings on your PC, hope that you meant to !

-DMS

How do I make the stupid Add Button Text Go away?

October 29, 2007 by axostech

when using Infragistics Web Grid, the Add button can be VERY annoying..

Try this undocumented property:

ug_surplus_information.Bands[0].AddButtonCaption = “”;

recommended by one of my friends Stephan Kajos..

-DMS