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");
}
Regular Expression to convert URL to Hyperlink
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>
Subscribe to:
Posts (Atom)