Regular Expression to convert URL to Hyperlink


using System.Text.RegularExpressions;
//this will turn all urls in the input parameter string sInput into
HTML hyperlinks

public string ConvertURLsToHyperlinks(string sInput)
{
return Regex.Replace(sInput, @"(\bhttp://[^ ]+\b)", @"$0");
}



Print contents of IFRAME from parent window

 
/* Jscript: Print contents of IFRAME from parent window */


<script language=JavaScript>

function CheckIsIE()
{
if (navigator.appName.toUpperCase() == 'MICROSOFT
INTERNET EXPLORER') { return true;}
else { return false; }
}


function PrintThisPage()
{

if (CheckIsIE() == true)
{
document.ifWorkspace.focus();
document.ifWorkspace.print();
}
else
{
window.frames['ifWorkspace'].focus();
window.frames['ifWorkspace'].print();
}

}

</script>

In the parent window, just put a link or button to call the PrintThisPage() method:

<a href="javascript:PrintThisPage();">Print This Page</a>

</pre>