can I disable a user control in a web page

  • Thread starter Thread starter Guest
  • Start date Start date
G

Guest

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?
 
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.
 
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?
 
Hi,
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
 
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
 
When you are talking about a user control, you DO mean an ASP.NET user
control right?
 
Back
Top