Click here to Skip to main content
Sign Up to vote bad
good
See more: C#ASP.NETAjax
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.
Posted 4 Aug '12 - 3:01


2 solutions

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[^]
 
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..
  Permalink  
Comments
_Amy - 4 Aug '12 - 11:15
I am sorry but my vote of 2, because you did a mistake while reading the question. Hyperlink1_Click event will be fired on master page itself and you are finding the hyperlink again in from the master page. You should find ModalPopupExtender1 and set the TargetControlID.
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
  Permalink  

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Your Filters
Interested
Ignored
     
0 Sergey Alexandrovich Kryukov 8,356
1 OriginalGriff 6,571
2 CPallini 3,533
3 Rohan Leuva 2,703
4 Maciej Los 2,234


Advertise | Privacy | Mobile
Web03 | 2.6.130516.1 | Last Updated 4 Aug 2012
Copyright © CodeProject, 1999-2013
All Rights Reserved. Terms of Use
Layout: fixed | fluid