Hi all, I have make an fix for printing focus problem on TabStrip with MultiPage.
In your TabStrip.htc file,
1- Add this function
-----------------------
function GetCookie(name) {
var arg = name+"=";
var i = 0;
while (i < element.document.cookie.length) {
var j = i + arg.length;
if (element.document.cookie.substring(i, j) == arg) {
var endstr = element.document.cookie.indexOf(";", j);
if (endstr == -1)
endstr = element.document.cookie.length;
return unescape(element.document.cookie.substring(j, endstr));
}
i = element.document.cookie.indexOf(" ", i) + 1;
if (i == 0)
break;
}
return null;
}
2- Inside the function f_Init() add
---------------------------------------
_Tabs = _bHorizontal ? oTBody.childNodes[0] : oTBody; //Line already exist
if ((GetCookie("LastIndex" + _Tabs.uniqueID) > 0) && (_nSelectedIndex == 0)) {
element.document.cookie = "PrintPreview" + _Tabs.uniqueID + "=1";
return;
}
3- Change the function f_NavigateMultiPage(oTab) to
-------------------------------------------------------------
function f_NavigateMultiPage(oTab)
{
var oTargetID = (oTab == null) ? null : oTab.getAttribute("targetid");
if (oTargetID != null)
{
var oTarget = element.document.all[oTargetID];
if (oTarget != null)
{
oTarget.setAttribute("activate", "true", 0);
}
}
else if (targetID != null)
{
var oTarget = element.document.all[targetID];
if (oTarget != null)
{
oTarget.selectedIndex = (GetCookie("PrintPreview"+_Tabs.uniqueID) == 1)?GetCookie("LastIndex"+_Tabs.uniqueID):_nSelectedIndex;
element.document.cookie = "LastIndex" + _Tabs.uniqueID + "=" + _nSelectedIndex;
element.document.cookie = "PrintPreview" + _Tabs.uniqueID + "=0";
}
}
}
Note: The limitation of this fix is that you can not combine TabStrip with AutoPostBack=True, with TabStrip with AutoPostBack=False on the same page.
Enjoy!