从.cs文件打开模式弹出窗口扩展程序 [英] opening modal popup extender from .cs file

查看:77
本文介绍了从.cs文件打开模式弹出窗口扩展程序的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

嗨朋友...
我正在使用在数据列表中显示图像.我从文件后面的代码打开Ajax模态弹出窗口扩展程序时遇到问题.
我已经编写了以下代码.

hi friends...
i am using showing images in datalist. i have problem in opening Ajax modal popup extender from code behind file.
i have written the following code.

DataListItem row = (DataListItem)(((ImageButton)e.CommandSource).NamingContainer);
           ImageButton ImageButton = (ImageButton)DataList1.Items[row.ItemIndex].FindControl("Image1") as ImageButton;
           Label lblnum = (Label)DataList1.Items[row.ItemIndex].FindControl("lblnum") as Label;
           AjaxControlToolkit.ModalPopupExtender modpopup = new AjaxControlToolkit.ModalPopupExtender();
           modpopup.TargetControlID = "ImageButton";
           modpopup.PopupControlID = "pnlDirImages";
           modpopup.BackgroundCssClass = "modalBackground";
           modpopup.CancelControlID = "btnclose";
           conn.Open();
           string strquery = "some query";
           SqlDataAdapter da = new SqlDataAdapter(strquery, conn);
           da.Fill(objds);
           conn.Close();
           if (objds.Tables[0].Rows.Count > 0)
           {
               dlImages.DataSource = objds.Tables[0];
               dlImages.DataBind();
               pnlDirImages.Visible = true;
               modpopup.Show();
           }
           else
           {
               pnlDirImages.Visible = false;

           }




请快速回复plas
谢谢u




please respond fast plaese
thank u

推荐答案

我已经找到了此解决方案,..
无需从代码后面分配任何值.只需从设计页面和目标控件将其处理到某个虚拟按钮,然后填充网格按钮功能.
您只显示模式弹出窗口.
它会解决这个问题..
如果您要代码..请回复..我会用代码解释
i have found this solution,,.
no need of assigning any value from code behind.u just handle it from design page and target control to some dummy button, then u fill grid button function.
u just show the modal popup.
it will solve this problem..
if u want code..please respond..i ll explain with code



请参考下面的链接可能对您有帮助.

http: //blogs.blackmarble.co.uk/blogs/rfennell/archive/2008/09/02/controlling-a-ajax-control-modalpopupextender-from-code-behind.aspx [ http://forums.asp.net/p/1016160/1366212.aspx [ ^ ]
Hi,
Please refer belowe links might be helpful to you.

http://blogs.blackmarble.co.uk/blogs/rfennell/archive/2008/09/02/controlling-a-ajax-control-modalpopupextender-from-code-behind.aspx[^]

http://forums.asp.net/p/1016160/1366212.aspx[^]


这篇关于从.cs文件打开模式弹出窗口扩展程序的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆