User Name Password Register
DaniWeb IT Discussion Community
All
What is DaniWeb IT Discussion Community?
You're currently browsing the ASP.NET section within the Web Development category of DaniWeb, a massive community of 430,111 software developers, web developers, Internet marketers, and tech gurus who are all enthusiastic about making contacts, networking, and learning from each other. In fact, there are 3,210 IT professionals currently interacting right now! Registration is free, only takes a minute and lets you enjoy all of the interactive features of the site.
Please support our ASP.NET advertiser: Lunarpages ASP Web Hosting
Views: 1343 | Replies: 3
Reply
Join Date: Nov 2007
Posts: 52
Reputation: dotNetDummi is an unknown quantity at this point 
Rep Power: 1
Solved Threads: 0
dotNetDummi's Avatar
dotNetDummi dotNetDummi is offline Offline
Junior Poster in Training

showModalDialog

  #1  
Jan 18th, 2008
Hi experts,

I used Window.showModalDialog to open comment.aspx.

I need to disable the X button(top right button of IE) in my comment.aspx as entering comments is compulsory.

I've done several days of research but to no avail.

I'm guessing that it's not possible even if I use javascript.

Any ideas how can I do that?
Serene Joey
AddThis Social Bookmark Button
Reply With Quote  
Join Date: Apr 2007
Posts: 257
Reputation: greeny_1984 is an unknown quantity at this point 
Rep Power: 2
Solved Threads: 10
greeny_1984's Avatar
greeny_1984 greeny_1984 is offline Offline
Posting Whiz in Training

Re: showModalDialog

  #2  
Jan 18th, 2008
Hi,
u need to disable the button on comments.aspx in the page load event right.u can use button.enable=false
in the page.load event.u can use document.getelementbyid("button").disabled=true in javascript .if there is some thing more in u r task post it.
Reply With Quote  
Join Date: Nov 2007
Posts: 52
Reputation: dotNetDummi is an unknown quantity at this point 
Rep Power: 1
Solved Threads: 0
dotNetDummi's Avatar
dotNetDummi dotNetDummi is offline Offline
Junior Poster in Training

Re: showModalDialog

  #3  
Jan 18th, 2008
Erm, Sorry what is the id for that button ?
I mean the top right corner "X" button.
Serene Joey
Reply With Quote  
Join Date: Dec 2007
Posts: 1
Reputation: viv.shankar is an unknown quantity at this point 
Rep Power: 0
Solved Threads: 0
viv.shankar viv.shankar is offline Offline
Newbie Poster

Re: showModalDialog

  #4  
May 20th, 2008
I am afraid it can't be done. I was looking for the same thing a couple of months back and apparently its not allowed for some nonsensical reason. If you want a good looking message or confirm box, you might wanna try doing it with JavaScript in the form of a div within a div. The outer div occupies the full screen and blanks it out (lightbox) and the inner div's the message. The only downside is its not a modal dialog. You can achieve that by passing a function reference and associated parameters in the showMessage JS function, and call them when the user clicks the OK button etc.

  1. var g_oncomplete = false;
  2. var g_eventArgs = false;
  3.  
  4. // onCompleteFunc: Function/Script in string format that will be executed using eval
  5. function showMessage(message, onCompleteFunc)
  6. {
  7. // Dump the onCompleteFunc and eventArgs into global vars
  8. g_oncomplete = onCompleteFunc;
  9.  
  10. // Display the message (check out Lightbox for ideas)
  11. }
  12.  
  13. // This is tied to the message's OK button.
  14. function ok_onclick()
  15. {
  16. if (onCompleteFunc && onCompleteFunc != "")
  17. eval(onCompleteFunc);
  18. }
This works well enough. I have got it running on a production environment and it hasn't given me any trouble. Hope it helps.

Cheers
- Vivek

Originally Posted by dotNetDummi View Post
Erm, Sorry what is the id for that button ?
I mean the top right corner "X" button.
Last edited by peter_budo : May 24th, 2008 at 7:10 pm. Reason: Keep It Organized - please use [code] tags
Reply With Quote  
Reply

Only community members can participate in forum threads. You must register or log in to contribute.

DaniWeb ASP.NET Marketplace
Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)

 

Thread Tools Display Modes

Similar Threads
Other Threads in the ASP.NET Forum

All times are GMT -4. The time now is 3:09 am.
Forum system based on vBulletin Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
©2003 - 2008 DaniWeb® LLC