Hi All,
I've manage to resize Frame A from Frame B, where Frame B has an
ImageButton that fires a JavaScript.
My problem is that Frame B posts back always.
I've read some workarounds like placing return false;, or the other
workaround is placing javascript:void(); at postBackUrl property of the
ImageButton, the latter worked, but the frame did not resize
Any clues on how to go about this?? Any help will be greatly
appreciated.
Regards,
Henry
SOURCE======================================================
<asp:ImageButton ID="ibtToggleNavFrame" runat="server"
ImageUrl="~/Image_Data/mhdToggleNavFrame.gif" Height="16px"
Width="16px" OnClick="ibtToggleNavFrame_Click" />
CODE BEHIND======================================================
protected void ibtToggleNavFrame_Click(object sender,
ImageClickEventArgs e)
{
clsWikiTech clsWikiTechInst = new clsWikiTech();
bolNavFrameState = (bool) ViewState["bolNavFrameState"];
if (bolNavFrameState == true)
{
Page.RegisterClientScriptBlock("",
clsWikiTechInst.jspCollapseNavFrame());
bolNavFrameState = false;
ViewState["bolNavFrameState"] = bolNavFrameState;
}
else
{
Page.RegisterClientScriptBlock("",
clsWikiTechInst.jspExpandNavFrame());
bolNavFrameState = true;
ViewState["bolNavFrameState"] = bolNavFrameState;
};
}
CLASS======================================================
public class clsWikiTech
{
public string jspCollapseNavFrame()
{
string strJavaScriptText = "";
strJavaScriptText = strJavaScriptText + "<script
type='text/javascript'> ";
strJavaScriptText = strJavaScriptText +
"window.parent.document.all.fstMain.cols='*,100%' ";
strJavaScriptText = strJavaScriptText + "</script>";
return strJavaScriptText;
}
public string jspExpandNavFrame()
{
string strJavaScriptText = "";
strJavaScriptText = strJavaScriptText + "<script
type='text/javascript'> ";
strJavaScriptText = strJavaScriptText +
"window.parent.document.all.fstMain.cols='216,*'; ";
strJavaScriptText = strJavaScriptText + "</script>";
return strJavaScriptText;
}
}