Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > can I disable a user control in a web page

Reply
Thread Tools

can I disable a user control in a web page

 
 
=?Utf-8?B?cm9u?=
Guest
Posts: n/a
 
      10-17-2006
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?
 
Reply With Quote
 
 
 
 
Steven Nagy
Guest
Posts: n/a
 
      10-17-2006
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?


 
Reply With Quote
 
 
 
 
=?Utf-8?B?cm9u?=
Guest
Posts: n/a
 
      10-17-2006
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?

>
>

 
Reply With Quote
 
Laurent Bugnion
Guest
Posts: n/a
 
      10-17-2006
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
 
Reply With Quote
 
=?Utf-8?B?cm9u?=
Guest
Posts: n/a
 
      10-17-2006
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?

>
>

 
Reply With Quote
 
Steven Nagy
Guest
Posts: n/a
 
      10-17-2006
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

 
Reply With Quote
 
Steven Nagy
Guest
Posts: n/a
 
      10-17-2006
When you are talking about a user control, you DO mean an ASP.NET user
control right?

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Web User Control with GridView can derive new Web User Control? ABC ASP .Net 1 10-04-2005 12:29 PM
Web User Control with GridView can derive new Web User Control? ABC ASP .Net Web Controls 0 10-03-2005 10:23 AM
Web User Control with GridView can derive new Web User Control? ABC ASP .Net 0 10-03-2005 10:23 AM
accessing the web user control's control from a web page and set a value from another web page Reny J Joseph Thuthikattu ASP .Net 1 12-30-2004 12:21 PM
how to enable/disable validation controls in the web user control and main page... buran ASP .Net 2 09-26-2003 06:29 PM



Advertisments