从后面的代码绑定fancybox到ImageButton [英] bind fancybox to ImageButton from code behind
问题描述
如何从页面加载后面的代码动态绑定fancybox到图像按钮,使用注册启动脚本,类型iframe和花式框应该显示我传递给它的URL,我该如何实现这个
i必须导航到imagebutton clientclick中的fancybox中请求的URL,
所以我想在页面加载代码中注册customerscript
<实际上,我必须根据点击的图像在fancybox中显示网站[另一个域名]
i希望在页面加载代码中完成所有绑定由于一些网站受到限制,我会检查数据库的用户权限并允许/拒绝网站访问
网站显示在精美的框中iframe
谢谢,
这是我的代码:
string strscript =@< script type =''text / javascript''> $(document).ready(function(){$(''#+ imgBtnID.ID +'') .fancybox({''type'':' iframe'',''width'':+ _strWidth +,''height'':+ _strHeight +,''href'':''+ _strURL +''}}});< /脚本>中; ClientScript.RegisterStartupScript(typeof(ImageButton),script_+ imgBtnID.ID,strscript,false);
(document).ready(function(){
(''# + imgBtnID.ID +'')。fancybox({''type'':''iframe'',''width'':+ _strWidth +,''height'':+ _strHeight +,' 'href'':''+ _strURL +''}}});< / script>; ClientScript.RegisterStartupScript(typeof(ImageButton),script_+ imgBtnID.ID,strscript,false);
How to dynamically bind fancybox to image button from code behind in page load, using register startup script,type iframe and the fancy box should display the url i passed to it, how can i achieve this
i have to navigate to the requested url in fancybox in imagebutton clientclick,
so i want to register clientscript in page load code behind
actually i have to show websites[another domain] in fancybox based on images clicked
i want all the bindings to be done in page load code behind since some sites are restricted, I would check database for user permissions and allow/deny site access
the site is shown in fancy box iframe
thanks,
This is my code:
string strscript = "@<script type=''text/javascript''>$(document).ready(function(){$(''#" + imgBtnID.ID + "'').fancybox({''type'': ''iframe'',''width'':" + _strWidth + ",''height'': " + _strHeight + ",''href'':''" + _strURL + "''})});</script>"; ClientScript.RegisterStartupScript(typeof(ImageButton), "script_" + imgBtnID.ID, strscript, false);
(document).ready(function(){
(''#" + imgBtnID.ID + "'').fancybox({''type'': ''iframe'',''width'':" + _strWidth + ",''height'': " + _strHeight + ",''href'':''" + _strURL + "''})});</script>"; ClientScript.RegisterStartupScript(typeof(ImageButton), "script_" + imgBtnID.ID, strscript, false);
这篇关于从后面的代码绑定fancybox到ImageButton的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!