473,395 Members | 1,527 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

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

disable parent window when popup is open and enable when popup window is closed

Expand|Select|Wrap|Line Numbers
  1. string url = string.Format("window.open('PSAContractSelection.aspx?appTitle=(0)&appName={1}', '_blank','toolbar = 0,menubar = no,scrollbar = no,mainmenu = no,height = 800,width = 920')",ddlList.SelectedItem.Text.Trim(),ddlList.SelectedItem.Value.Trim());
  2.             ScriptManager.RegisterStartupScript(Page, Page.GetType(), "newWindow",url , true);  
this is the codebehind java script i am using for the popup window to show up. now i need to see the parent window graded out or disabled when the popup window is open. any help please
Mar 8 '13 #1
3 7552
acoder
16,027 Expert Mod 8TB
Why do you want to disable the parent window?

You can try the following:
1. Keep a reference to the child window when you create it
Expand|Select|Wrap|Line Numbers
  1. var child_window = window.open()
2. When the parent window gains focus, check for the existence of this window.
3. If exists, give focus back to the child window.

A better alternative is to create an overlay/popup within the original window, e.g. like a lightbox or similar.
Mar 8 '13 #2
dropdown selected value gives me the popup and i should not be able to click on any other controls on the parent window until i close the popup window . that's the requirement. the script is in the dropdownlistselectedIndexChanged()method in codebehind.All my controls in my aspx page are with in update panel control and i could not tamper with it for some reason. I dont have html and body tags to use functions with in my aspx page. thats the reason why i had to go with script manager method . I am all over the internet and could not any thing . sorry to bore you with all this . I am new to asp and C#, both , any suggestion where to find some code or any other approach to get this done would be helpful
Mar 8 '13 #3
acoder
16,027 Expert Mod 8TB
If you're having issues with the server-side code, ASP.NET, C#, update panels, etc., ask in the appropriate .NET forum.

As for a JavaScript solution, search for a lightbox alternative. There are some very good lightweight ones which will fulfil your requirement.
Mar 8 '13 #4

Sign in to post your reply or Sign up for a free account.

Similar topics

2
by: kelli | last post by:
I am using an iframe to feed an RSS but when i click on the link on the iframe it opens the link on the iframe instead of opening it on the parent window or a new window.. the code is in php.. its...
1
by: Michal Adamski | last post by:
I'm trying to make a popup. The code I pasted below works, but my problem is, that I want the http://www.mypage.com to open in the same browser window. So I need something instead of window.open()....
23
by: Markus | last post by:
Hi, i have this problem: Sometimes, i can't reproduce, if i click on an small image on the website, the popup _AND_ an other Tab in firefox open. Here are the linkcode: <div...
2
by: yatharth | last post by:
I am facing a problem ,the situation is like this. I have a home page named "Index.html" ,on which there is login link,when i click on the login link the login popup opens and user enter the...
5
by: Nathan Sokalski | last post by:
How do I open and change properties of (such as size, position, scroll position, visibility of toolbars, etc.) a browser window? Thanks. -- Nathan Sokalski njsokalski@hotmail.com...
2
by: John at Free Design | last post by:
Can anyone help with how to use the Response.Redirect method to open a page in a new instance of the browser. In this case it is a report. When the user selects a report from a list then I want...
6
by: harman.sidhuz | last post by:
Hi How we can disable parent window while popup window is open? i am using window.open() method to open new popup window. As per my requirement, showModalDialog() or showModelessDialog() is not...
0
by: mpar16 | last post by:
Hi, I need help: when i open a popup in asp.net for a while parent page(main page) session get expires after a while. But still it waits until i close child popup.i have tried following solutions ...
2
mageswar005
by: mageswar005 | last post by:
hi guys, Any one tell me, how i can disable parent window when i open child popup window.
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...

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.