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

How can I use "menubar=no"

P: n/a
In JavaScript, I can hide menu bar
( ex)
<html>
<SCRIPT LANGUAGE="JavaScript">
function Test()
{
var win =
window.open("test2.html","sale","menubar=no,scroll bars=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.
Nov 18 '05 #1
Share this Question
Share on Google+
2 Replies


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

"edgarjang" <ed*******@msn.com> wrote in message
news:uM**************@TK2MSFTNGP10.phx.gbl...
In JavaScript, I can hide menu bar
( ex)
<html>
<SCRIPT LANGUAGE="JavaScript">
function Test()
{
var win =
window.open("test2.html","sale","menubar=no,scroll bars=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.


Nov 18 '05 #2

P: n/a
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,
ti**@tienonsoftware.com

"edgarjang" <ed*******@msn.com> wrote in message
news:uM**************@TK2MSFTNGP10.phx.gbl...
In JavaScript, I can hide menu bar
( ex)
<html>
<SCRIPT LANGUAGE="JavaScript">
function Test()
{
var win =
window.open("test2.html","sale","menubar=no,scroll bars=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.

Nov 18 '05 #3

This discussion thread is closed

Replies have been disabled for this discussion.