How can I use "menubar=no"

  • Thread starter Thread starter edgarjang
  • Start date Start date
E

edgarjang

In JavaScript, I can hide menu bar
( ex)
<html>
<SCRIPT LANGUAGE="JavaScript">
function Test()
{
var win =
window.open("test2.html","sale","menubar=no,scrollbars=no,width=780,height=5
40,top=0,left=0")
window.opener = "OPENER_IS_NOT_NULL";
window.close();
}

</SCRIPT>
<body>
<input id="ttt" type="button" onClick="Test()">
</body>
</html>

I want to adopt this in default.aspx.
So. In Browser, http://.../default.aspx --> menu bar is not displayed in
browser.

But I don't know this in asp.net.
 
There are several ways to harness a button click to make it do client side
stuff. I show one way below. Not sure if this is responsive to your
question....

Private Sub Button1_Click _
(ByVal sender As System.Object, _
ByVal e As System.EventArgs) _
Handles Button1.Click
Dim sb As New System.Text.StringBuilder
sb.Append("<SCRIPT LANGUAGE=""JavaScript"">")
sb.Append("{")
sb.Append("var win =")
sb.Append("window.open('http://www.gc.ca','sale',")
sb.Append("'menubar=no,scrollbars=no,")
sb.Append("width=780,height=540,top=0,left=0');")
sb.Append("window.opener = 'OPENER_IS_NOT_NULL';")
sb.Append("window.close();")
sb.Append("}")
sb.Append("</SCRIPT>")
Literal1.Text = sb.ToString
End Sub

<form id="Form1" method="post" runat="server">
<P>
<asp:Button id="Button1" runat="server" Text="Click
Me"></asp:Button></P>
<P>
<asp:Literal id="Literal1" runat="server"></asp:Literal></P>
</form>

Ken
MVP [ASP.NET]
 
I'm not sure there is some tricky tips for your request but usually you
cannot hide/show layout components (menu, toolbar...) of current web browser
(which currently contain your web page).

There is simple way (but annoy visitor), put window.onload method in your
default.aspx, which open other window with menubar=0, which is second
default page e.g. default2.aspx (using window.open) and then close current
window (which contain default.aspx).

Tiendq,
(e-mail address removed)
 
Back
Top