Resize Frame

W

wardemon

Hi,
I was wondering how can one the following in ASP.net

a. Resize (Collapse/Expand) Frame A from Frame B
b. Resize (Collapse/Expand) Frame A from Frame A

example A I believe is found at MSDN or at Microsoft TechNet website.

Thanks,
Henry :)
 
W

wardemon

Hi All,

Ok, I got Resizing Frame to work, it's quite fast, however, whenever
I click on the ImageButton1 which collapses the Frame, I can hear a
"tic" sound from my speakers, and status bar in IE showed a message and
progress bar in IE showed a quick loading blue bar.

My question is now, how does Microsoft TechNet collapses and expands
its frame without the "reload feeling" as mentioned above? Reference
site is at :
http://technet2.microsoft.com/Windo...b7d8-42c3-b6c9-59c145b7765f1033.mspx?mfr=true

When one clicks the small x button beside the word sync toc at the
left frame, it collapses the left frame without any "reload feeling",
then the contents frame in the right, a image when a label "show toc"
appeared, which leads me to my second question, how did they do this? a
floating div originating from the left nav frame? if originating in the
left nav frame, then that flating div actually can cross frames?

Thanks,
Henry :)


Solution to collapse frame, but with a "reload feeling" :
=========================================
protected void ImageButton1_Click(object sender,
ImageClickEventArgs e)
{
string javascript;
javascript = "<script type='text/javascript'>
window.parent.document.all.fstMain.cols='*,100%' </script>";

Page.RegisterClientScriptBlock("", javascript) ;
}
 
W

wardemon

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;
}
}
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,012
Latest member
RoxanneDzm

Latest Threads

Top