.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Win Surprise Gifts!!!

Top 5 Contributors of the Month
Gaurav Pal
Post New Web Links

Problem with a Javascript Popup Window Minimizing itself

Posted By:      Posted Date: October 06, 2010    Points: 0   Category :ASP.Net

I am new to Javascript.  I have seen other posts about this, but I have not been able to resolve my problem. I have a WebPage that allows a user to click a LinkButton. When the LinkButton is clicked. I execute the following Javascript code after registering the ClientScriptBlock:

<script language='Javascript'>
PopupWindow = window.open('StandardImageLookupPage.aspx','PopupWindow');
PopupWindow.resizeTo(screen.width, screen.height);

No matter what I do the popup window comes up for a brief second and then minimizes itself. I prefer that the window stays maximized.

I am stumped. Any help would be much appreciated.

ps. I am not sure if this makes a difference, but the WebForm that calls this javascript is a user control.

View Complete Post

More Related Resource Links

Problem when displaying a popup window

Hi all,
I am working on a project in which when I clicked a hyperlink a pop up window has to be displayed for 2 pages.
But at first when i did this in javascript it worked, later after i finished the whole coding suddenly an error box displayed that there is an error in webpage and want to debug

javascript window.history.back() issue with Modal popup extender



I have a asp.net page that has a list of items. When one of the items from the list is clicked a details page is displayed. This details page has a link button to show a popup for history of the item. The details page also has a button with text 'Back'.  The back button has onclick event set to  "javascript:window.history.back();".

This back button works fine and goes back to the first page. However when the user is on the second page and opens the pop up by clicking on the link button, the back button stop working and displays Webpage has expired message.

Any help would be appreciated.




javascript window.open problem



i have a page(A page) which has a linkbutton on it and i have added the following onattribute method which opens a new popup window(B page)


"onclick", "window.open('" & likeLink & "','newwindow','location=no,toolbar=no,directories=no,menubar=no,width=300,height=400,resizable=yes,scrollbars=yes,top=200,left=250,status=no'); return false;")

now on page B which has poped up there are some links

here is

javascript popup window...


hi to all,

i want to open a popup window, when click a link in the gridview.

i done this.

my problem is, the popup will be model popup, user can't do any in the page before closing the popup window.

and also i have a button in my popup window, when the button clicked,

i want to update some values to DB, popup window close and also the main page need to refresh (then only the updates load in grid.)

how to solve this.

thanks in advance

Sharepoint and SQL SSRS viewer javascript:void window.open Problem


Ok, I've seen a number of threads similar to this, but I think i have my situation narrowed down pretty tight.

I'm using the javascript:void(window.open action to "pop-up" a drill through report on an SSRS report.  the function works just fine when viewing in the SSRS report viewer...however...


- If i display this report with this function in Sharepoint via the Report VIEWER (or page viewer) web part...the functionality of the pop-up no longer works....

and heres the strange part...

If i put a report EXPLORER part in, and have it set to list the report with the function (also passing what report to open) into a report viewer web part...THE FUNCTION NOW WORKS!?

 The SSRS "Jump to URL" action is ="javascript:void(window.open('http://www.google.com'))"

Any thoughts?

It's very strange indeed.  So to summarize,

- Javascript popup worsk in native sql report server interface

- Javascript popup works if the Sharepoint viewer web part GOT its report to view from a report explorer web part

- Javascript popup does NOT repeate NOT work when using a Sharepoint report viewer to directly open the report.

Modal popup window in ASP.Net

A Masked div or modal popup window is a child window created from the parent window which prevents the user from interacting with parent window before he returns to the parent application.

Open PopUp Window From Error httpModule


I would like to open a popup window from the assembly to present the information to the user. Does anyone know if this is possible, I am presently doing the following:

        WriteLine("body {font-family:""Verdana"";font-weight:normal;font-size: .7em;color:black; background-color:white;}")
        WriteLine("b {font-family:""Verdana"";font-weight:bold;color:black;margin-top: -5px}")
        WriteLine("H1 { font-family:""Verdana"";font-weight:normal;font-size:18pt;color:red }")
        WriteLine("H2 { font-family:""Verdana"";font-weight:normal;font-size:14pt;color:maroon }")
        WriteLine("pre {font-family:""Lucida Console"";font-size: .9em}")

problem in consuming WCF service through Window application


I have a silverlight application and WCF service all made in VS 2010 , i had hosted my site to web server which contain Window 2008 and IIS 7.0

now the problem is i have another application which is a window application developed in VS2008 , when i try to add the service reference it gives me error


The document at the url was not recognized as a known document type.

The error message from each known type may help you fix the problem:

- Report from 'DISCO Document' is 'There was an error downloading 'http://dev_qa.emspa.com/HRDev3/Service.svc?disco'.'.

  - The request failed with HTTP status 400: Bad Request.

- Report from 'WSDL Document' is 'The document format is not recognized (the content type is 'text/html; charset=UTF-8').'.

- Report from '' is 'The document format is not recognized (the content type is 'text/html; charset=UTF-8').'.

- Report from 'XML Schema' is 'The document format is not recognized (the content type is 'text/html; charset=UTF-8').'.

Metadata contains a reference that cannot be resolved: ''.

Content Type application/soap+xml; charset

way of calling "javascript function of parent window from child window."

The article way of calling "javascript function of parent window from child window." was added by raja.s on Sunday, June 06, 2010.

Hi,Here i am going to explain how to call the javascript function of a parent window from the child window(pop-Up).Some may know before reading this post.Parent Java Script Function:script language="Javascript" type="text/javascript">

What's the problem in my javascript's code to get ClientID Property?



 Hi all.

I wirte a simple java script code to get ClientID of controls on the webform. The code is like:

<script type="text/javascript" language="javascript">

var butt = $find("<%= Button1.ClientID %>");



But when i run it , i have a problem. The probmel is:


Server Error in '/' Application.

The Controls collection cannot be modified because t

Browser window is opening up on the second click with javascript code



I am trying to set a javascript code to open up a new browser window with this URL that exists like shown below.

On the first click nothing happens but on the second click the browser window is opening up.


How is it possible to make it open up on the first click ?

                                <asp:ImageButton ID="ImageButton3" runat="server" Height="84px" 
                                    ImageUrl="~/images/1.jpg" Width="165px" 
                                    onclick="ImageButton3_Click" />

    protected void ImageButton3_Click(object sender, ImageClickEventArgs e)
        String openURL = "javascript:window.open('" + "Folder1/testing.aspx" + "');return false;";
        ImageButton3.OnClientClick = openURL;


Closing Javascript Modal dialog window after server side event processing


Hello Friends..

Please tell me how to close Javascript ModelDoalog Window.. after Server Side event Processing .

Basically i want close window in  finally Block After sucessfulll Updation.

AMit..... InnocentInnocentInnocentInnocentInnocentInnocentInnocent

Refresh parent window and close popup window.


Hi All,

I've been spent the last couple hours trying to work on this issue. I an creating Facebook Oauth stuff, when i click on parent window. The popup shows the Facebook login, when i logged in with my details, it redirects to my site. But i need to close this popup after returning and refrsh the parent window.

can you please provide me this kind of stuff. i already spent whole day in this... Sealed Cry

If i could solve this then i will go for another logic but stucked on 1st step.



Problem in getting contol id in JavaScript


Hi want to get the Control ID in a javascrip so that i assign some value in it. 

document.getElementById('<%=hiddenSplitterCollapsedState.ClientID%>').value = mode

but on running .aspx page it's giving an Error

The Controls collection cannot be modified because the control contains code blocks (i.e. <% ... %>).

The Controls collection cannot be modified because the control contains code blocks (i.e. <% ... %>).

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.Web.HttpException: The Controls collection cannot be modified because the control contains code blocks (i.e. <% ... %>).

Source Error:

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

Stack Trace:


Menu doesn't popup when WIndow style set to AllowsTransparency="True" WindowStyle="None"

Hi,I'm facing an issue, when using Window style set to AllowsTransparency="True" WindowStyle="None", my menus in menubar doesn't popup, rather they gets hidden (not visible) and if you just click by guess then menu item will be executed, its just that menu item is not shown visisble.However, if I revert back the Window style to normal without Transparency then menus visible(popup) perfectly.I'm not sure what could be an issue?San

>>> Open a Popup window on Successful Login if something new added to website.

Hi, I would like to open a Popup window in Parallel if user Login successfully. The popup will give updates to the user that what's new added to the website. The popup will open only once if user login. If he logout and will re-login then it should not popup as we'll assume that he has been notified earlier. I have users table with user id's. It is for information that I am working in Framework 2.0 and not allowed to use any third party or AjaxToolkit. Therefore javascript or any other technique will resolve the issue. Any idea with coding example would be helpful.

collapsiblepanel problem with javascript

Hiiii Coders, I have 4 collapsible panels on my page. Now i am using below javascript code for expanding and collapsing all the panels at the same time.  <script type="text/javascript"> function TogglePanels() { var panels = ["cpe1", "cpe2", "cpe3", "cpe4"]; for (var i = 0; i < panels.length; i++) $find(panels[i])._toggle(); } </script>here is my code for linkbutton (collapse all/expand all) and collapsiblepanel extenders<tr> <td align="right" valign="top"> <p style="text-align:right;"> <asp:LinkButton ID="L1" runat="server" Text="expand all" OnClientClick="TogglePanels();this.innerText=this.innerText=='expand all'?'collapse all':'expand all'; return false;"> </asp:LinkButton> </p> </td> </tr> <tr> <td> <cc1:CollapsiblePanelExtender ID="cpe1" runat="Server" TargetControlID="Panel1" ExpandControlID="Panel2" CollapseControlID="Panel2" BehaviorID="cpe1"
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend