By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
435,435 Members | 2,891 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 435,435 IT Pros & Developers. It's quick & easy.

Resize Frame

P: n/a
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 :)

Nov 20 '06 #1
Share this Question
Share on Google+
2 Replies


P: n/a
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/Window....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) ;
}

Nov 21 '06 #2

P: n/a
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='*,10 0%' ";
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;
}
}

Nov 21 '06 #3

This discussion thread is closed

Replies have been disabled for this discussion.