单击超链接时打开模型弹出窗口

问题描述:

亲爱的代码项目成员

我想在HyperLink的单击上打开Ajax Model PopUp.我的HyperLink位于MasterPage上,而PopUp位于常规页面上.请帮助我实现这一目标.

Dear Code Project Members

I want to open Ajax Model PopUp on HyperLink''s click. My HyperLink is on MasterPage & PopUp is on normal page. Please help me to achieve this.

我认为您还没有听说过Google搜索引擎

在代码背后的Hyperlink1_Click事件中,使用此代码
I think you have not heard of Google Search engine

In the Hyperlink1_Click event in code-behind use this code
ModalPopupExtender1.TargetControlID=(this.MasterPage.FindControl("Hyperlink1") as HyperLink).ID;
ModalPopupExtender1.Show();



http://www.asp.net/ajaxLibrary/AjaxControlToolkitSampleSite/ModalPopup/ModalPopup.aspx [a> [ ^ ]

http://www.dotnetcurry.com/ShowArticle.aspx?ID=285 [ ^ ]

ASP.NET AJAX控件工具包ModalPopupExtender控件的作用 [ ^ ]

http://csharpdotnetfreak.blogspot.com/2011/03/ajax-modalpopupextender-example- aspnet.html [ ^ ]

为您提供的其他信息是,可以使用Button,ImageButton或Hyperlink和其他类似的控件打开ModalPopup..



http://www.asp.net/ajaxLibrary/AjaxControlToolkitSampleSite/ModalPopup/ModalPopup.aspx[^]

http://www.dotnetcurry.com/ShowArticle.aspx?ID=285[^]

ASP.NET AJAX Control Toolkit ModalPopupExtender Control in Action[^]

http://csharpdotnetfreak.blogspot.com/2011/03/ajax-modalpopupextender-example-aspnet.html[^]

The additional information for you is that ModalPopup can be opened with Button, ImageButton or Hyperlink and other similar controls..


请尝试以下操作:
Try this:
ModalPopupExtender ModalPopupExtender1 = new ModalPopupExtender();
ModalPopupExtender1.TargetControlID = Hyperlink1.ClientID; 
// Here you can set directly ID also.
//Now show your Model Popup.
ModalPopupExtender1.Show();




--Amit




--Amit