can I disable a user control in a web page

Discussion in 'ASP .Net' started by =?Utf-8?B?cm9u?=, Oct 17, 2006.

  1. 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?
     
    =?Utf-8?B?cm9u?=, Oct 17, 2006
    #1
    1. Advertising

  2. =?Utf-8?B?cm9u?=

    Steven Nagy Guest

    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?
     
    Steven Nagy, Oct 17, 2006
    #2
    1. Advertising

  3. 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?

    >
    >
     
    =?Utf-8?B?cm9u?=, Oct 17, 2006
    #3
  4. 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
     
    Laurent Bugnion, Oct 17, 2006
    #4
  5. 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?

    >
    >
     
    =?Utf-8?B?cm9u?=, Oct 17, 2006
    #5
  6. =?Utf-8?B?cm9u?=

    Steven Nagy Guest

    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
     
    Steven Nagy, Oct 17, 2006
    #6
  7. =?Utf-8?B?cm9u?=

    Steven Nagy Guest

    When you are talking about a user control, you DO mean an ASP.NET user
    control right?
     
    Steven Nagy, Oct 17, 2006
    #7
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. buran
    Replies:
    2
    Views:
    1,854
    buran
    Sep 26, 2003
  2. Reny J Joseph Thuthikattu
    Replies:
    1
    Views:
    606
    =?Utf-8?B?UHJha2FzaC5ORVQ=?=
    Dec 30, 2004
  3. ABC
    Replies:
    1
    Views:
    2,675
    Larry
    Oct 4, 2005
  4. ABC
    Replies:
    0
    Views:
    507
  5. ABC
    Replies:
    0
    Views:
    227
Loading...

Share This Page