Click here to Skip to main content
15,887,683 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I am calling javascript from code behind in following way on page load it works fine but when it doesnt work when i open same page in popup/dialog box


VB
If Not ClientScript.IsStartupScriptRegistered("") Then
 Page.ClientScript.RegisterStartupScript(Me.[GetType](), "", "fillexchange();", True)
 End If




Is there any partcular reason
Posted
Updated 17-Jan-12 3:13am
v3

If your popup/dialog is opened using window.open syntax then it will work.But if you are using JQuery or similar dialogs then it wont fire this event as the context of the dialog will be the current page in which the script is already registered.

Regards,
Prasad P. Khandekar
 
Share this answer
 
Comments
[no name] 18-Jan-12 0:41am    
this comment from abhishek
You need to add this code on the Page_Load of parent page. It will work.
 
Share this answer
 
Comments
mayur csharp G 18-Jan-12 6:23am    
which code???????????
bbirajdar 18-Jan-12 9:27am    
The code which registers the javascript

If Not ClientScript.IsStartupScriptRegistered("") Then
Page.ClientScript.RegisterStartupScript(Me.[GetType](), "", "fillexchange();", True)
End If
I did
C#
Page.ClientScript.RegisterStartupScript(Type.GetType("System.String"), "addScript", "fillexchange()", True)
 
Share this answer
 
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900