-
window.open, won't
I am having a problem showing a new window with javascript. When a user clicks a linkbutton on my page, it should show BalanceReport.aspx with the accompanying parameters, instead it does nothing. It always works on my system (naturally), it always works on another users' system, and it never works on yet another users' system. In the Page_Load event I do some database stored procedure calls and fill a stringbuilder with HTML that is sent to the page in an asp:Literal control. That seems to work. Javascript is enabled on our browsers (IE6 xpSp2). There are no popup blockers on the suspect system, and other window.opens work. I am unsure where to look next.
This link works:
const string cOnClientClickTemplate = "javascript:window.open('ClaimPopup.aspx?CompPK={0}&ProviderName={1}&FundType={2}',";
const string cPopupDialogArgs = "'newWindow','width=500,height=450');return false;";
NewDiscClaim.OnClientClick = String.Format(cOnClientClickTemplate, ViewState["CompPK"].ToString(), ViewState["ProviderName"].ToString(), "disc") + cPopupDialogArgs;
This link does not work:
const string cOnClientClickReportTemplate = "javascript:window.open('BalanceReport.aspx?CompPK={0}',";
const string cReportDialogArgs = "'newWindow','width=800,height=800,resizable=yes, menubar=yes,toolbar=yes');return false;";
lbtnReport.OnClientClick = String.Format(cOnClientClickReportTemplate, ViewState["CompPK"].ToString()) + cReportDialogArgs;
Any ideas? Thanks.
-
Welcome to DevX 
 Originally Posted by goodideadave
I am having a problem showing a new window with javascript. When a user clicks a linkbutton on my page, it should show BalanceReport.aspx with the accompanying parameters, instead it does nothing. It always works on my system (naturally), it always works on another users' system, and it never works on yet another users' system.
Then it probably isn't your code. You need to check out the system the person is using where it doesn't work and figure out what is different on theirs from yours. There is no set in stone resolution for these kinds of issues. It is trial and error at its finest.
I don't answer coding questions via PM or Email. Please post a thread in the appropriate forum section.
Please use [Code]your code goes in here[/Code] tags when posting code.
Before posting your question, did you look here?
Got a question on Linux? Visit our Linux sister site.
Modifications Required For VB6 Apps To Work On Vista
-
First FYI : "javascript:blabla()" is not standard .. call the function directly :
OnEvent="blabla()" ...
second the general known issue is pop-up blocker ... IE6-SP2 has an embed pop-up blocker , Yahoo toolbar block pages without any prompt just a sound that may be not clear or turned off (the sound) ... and similar in many plugins that install them selfs without just the user know about them [like yahoo and msn toolbar if you don't choose custom install they come installed, in firefox the same for google toolbar]
so what I have first is to check the system yourself and see what happens, then the common mehod to prevent the blcking is to put the "window.open()" function just directly after a USER-CLICK event , the first executed statement .. in that case pop-blocker should never block it ...
hope this can help.
-
My suggestion is to use a hyperlink instead of link button. If u want to open the contents in a new window, u can use target="_blank" attribute, and u can give the url to which the path u want in the navigateurl attribute.
-
He doesn't need to change his code.
He needs to figure out why it doesn't work on this one PC.
I don't answer coding questions via PM or Email. Please post a thread in the appropriate forum section.
Please use [Code]your code goes in here[/Code] tags when posting code.
Before posting your question, did you look here?
Got a question on Linux? Visit our Linux sister site.
Modifications Required For VB6 Apps To Work On Vista
-
 Originally Posted by Hack
He doesn't need to change his code.
Why not .. maybe some times we need to change some code to be portable for all systems ... and machines types. [or generally we put handlers ..]
-
My experience has been that when code runs just fine on all but one or two PCs, 99.99% of the time it is because of an issue with the PC, not the code.
I don't answer coding questions via PM or Email. Please post a thread in the appropriate forum section.
Please use [Code]your code goes in here[/Code] tags when posting code.
Before posting your question, did you look here?
Got a question on Linux? Visit our Linux sister site.
Modifications Required For VB6 Apps To Work On Vista
-
Similar Threads
-
Replies: 1
Last Post: 08-25-2002, 09:56 PM
-
By Greg Rothlander in forum ASP.NET
Replies: 2
Last Post: 11-24-2001, 03:46 PM
-
Replies: 2
Last Post: 07-26-2001, 05:06 PM
-
Replies: 1
Last Post: 07-17-2001, 07:53 PM
-
Replies: 0
Last Post: 06-05-2001, 02:21 PM
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
Forum Rules
|
Top DevX Stories
Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL
|
Bookmarks