Connecting Tech Pros Worldwide Forums | Help | Site Map

How can I use "menubar=no"

edgarjang
Guest
 
Posts: n/a
#1: Nov 18 '05
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.



Ken Cox [Microsoft MVP]
Guest
 
Posts: n/a
#2: Nov 18 '05

re: How can I use "menubar=no"


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" <edgarjang@msn.com> wrote in message
news:uMAZCEh5DHA.1852@TK2MSFTNGP10.phx.gbl...[color=blue]
> 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.
>
>[/color]

Do Quyet Tien
Guest
 
Posts: n/a
#3: Nov 18 '05

re: How can I use "menubar=no"


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,
tien@tienonsoftware.com

"edgarjang" <edgarjang@msn.com> wrote in message
news:uMAZCEh5DHA.1852@TK2MSFTNGP10.phx.gbl...[color=blue]
> In JavaScript, I can hide menu bar
> ( ex)
> <html>
> <SCRIPT LANGUAGE="JavaScript">
> function Test()
> {
> var win =
>[/color]
window.open("test2.html","sale","menubar=no,scroll bars=no,width=780,height=5[color=blue]
> 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.
>
>[/color]


Closed Thread