Click here to Skip to main content
15,890,438 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,

I am unable to open popup when i using gridview image column click..

code is below.

VB
If e.CommandName = "Access" Then
          Dim EmpNumber As Integer = Convert.ToInt32(e.CommandArgument)
          Dim tmp As String = ""
          tmp = "<script language='javascript'>"
          tmp += "window.open(AccessPrivilleges.aspx?EmpNumber=" & EmpNumber & "','width=400,height=320')"
          tmp += "</script>"
          'Page.ClientScript.RegisterClientScriptBlock(Me.[GetType](), "MyScript", tmp)
          System.Web.UI.ScriptManager.RegisterClientScriptBlock(Me.Page, Me.GetType(), "myscript", tmp, True)
      End If



please. help.

Regards,
Ganesh.S
Posted
Updated 22-Jun-11 22:44pm
v2

Fix this line of yours:
tmp += "window.open(AccessPrivilleges.aspx?EmpNumber=" & EmpNumber & "','width=400,height=320')"

Right now, here the page name is not in quotes and thus when it will be executed your code would try to find a variable named "AccessPrivilleges.aspx?EmpNumber=" which is incorrect. make sure the syntax used is correct and the whole javaScript tag formed is correct.

Put a break point, use VS debugger and VS watch to see what is formed as 'tmp' before you assign it to be used in RegisterClientScriptBlock. The script tag formed should be such that if you copy paste it in a normal page or in designer it works.

Try!
 
Share this answer
 
hi,
Use ajax toolkit,then set behavior id and target control id properly in model popup extender
thnks
 
Share this answer
 

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