472,126 Members | 1,459 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,126 software developers and data experts.

can I disable a user control in a web page

ron
1. Can I disable a user control in a web page?
2. Can I disable the 'close' function on the top-right corner of a popup
window, so I can use code-behind function to close the browser?
Oct 17 '06 #1
6 9986
1. Yes. All controls have an "enabled" property which can be set to
false.
2. No. Possibly javascript might let you, although I doubt it. You have
to remember that ASP.NET is server side code, which means it can do
stuff on the server like talk to databases. Javascript is client side
code. It can do stuff funky in the browser, muck around with windows,
etc.

ron wrote:
1. Can I disable a user control in a web page?
2. Can I disable the 'close' function on the top-right corner of a popup
window, so I can use code-behind function to close the browser?
Oct 17 '06 #2
ron
Thank you, Steven.

For the second question, I found two methods in javascript:

1. window.open
2. window.showModalDialog

There is no way to disable 'close' function for those methods, do you have
other way to handle that?

"Steven Nagy" wrote:
1. Yes. All controls have an "enabled" property which can be set to
false.
2. No. Possibly javascript might let you, although I doubt it. You have
to remember that ASP.NET is server side code, which means it can do
stuff on the server like talk to databases. Javascript is client side
code. It can do stuff funky in the browser, muck around with windows,
etc.

ron wrote:
1. Can I disable a user control in a web page?
2. Can I disable the 'close' function on the top-right corner of a popup
window, so I can use code-behind function to close the browser?

Oct 17 '06 #3
Hi,

ron wrote:
Thank you, Steven.

For the second question, I found two methods in javascript:

1. window.open
2. window.showModalDialog

There is no way to disable 'close' function for those methods, do you have
other way to handle that?
No way. The browser's interface is protected by strict security,
JavaScript has very little rights to interact with the default chromes.

HTH,
Laurent
--
Laurent Bugnion, GalaSoft
Software engineering: http://www.galasoft-LB.ch
PhotoAlbum: http://www.galasoft-LB.ch/pictures
Support children in Calcutta: http://www.calcutta-espoir.ch
Oct 17 '06 #4
ron
I did not find 'enabled' property for user control.

"Steven Nagy" wrote:
1. Yes. All controls have an "enabled" property which can be set to
false.
2. No. Possibly javascript might let you, although I doubt it. You have
to remember that ASP.NET is server side code, which means it can do
stuff on the server like talk to databases. Javascript is client side
code. It can do stuff funky in the browser, muck around with windows,
etc.

ron wrote:
1. Can I disable a user control in a web page?
2. Can I disable the 'close' function on the top-right corner of a popup
window, so I can use code-behind function to close the browser?

Oct 17 '06 #5
Ron,

As Laurent suggests, you can't do it.
If you think about it, this is a good thing.
Otherwise every site would be doing it, and no one would ever be able
to close a browser window.

Steven

Oct 17 '06 #6
When you are talking about a user control, you DO mean an ASP.NET user
control right?

Oct 17 '06 #7

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

1 post views Thread by chavdar | last post: by
1 post views Thread by Barbara Alderton | last post: by
4 posts views Thread by Mark | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.