我使用gridview image column clik时无法打开弹出窗口 [英] unable to open popup when i uing gridview image column clik
问题描述
当我使用gridview图像列单击时,无法打开弹出窗口..
代码如下.
Hi,
I am unable to open popup when i using gridview image column click..
code is below.
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
请.帮助.
问候,
Ganesh.S
please. help.
Regards,
Ganesh.S
推荐答案
修复您的这一行:
Fix this line of yours:
tmp += "window.open(AccessPrivilleges.aspx?EmpNumber=" & EmpNumber & "'',''width=400,height=320'')"
现在,这里的页面名称没有用引号引起来,因此在执行该页面时,您的代码将尝试找到一个名为"AccessPrivilleges.aspx?EmpNumber =的变量,这是不正确的.确保使用的语法正确,并且形成的整个javaScript标签正确.
放置一个断点,在将其分配给RegisterClientScriptBlock使用之前,请使用VS调试器和VS watch来查看形成为"tmp"的形式.形成的脚本标签应这样,以便在复制时将其粘贴到普通页面或设计器中就可以使用.
试试吧!
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!
使用ajax工具箱,然后在模型弹出扩展器中正确设置行为ID和目标控件ID
thnks
Use ajax toolkit,then set behavior id and target control id properly in model popup extender
thnks
这篇关于我使用gridview image column clik时无法打开弹出窗口的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!