Click here to Skip to main content
11,703,617 members (69,261 online)
Rate this: bad
Please Sign up or sign in to vote.
See more: C# ASP.NET Ajax
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:01am
Rate this: bad
Please Sign up or sign in to vote.

Solution 1

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;

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

The additional information for you is that ModalPopup can be opened with Button, ImageButton or Hyperlink and other similar controls..
_Amy at 4-Aug-12 11:15am
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.
Rate this: bad
Please Sign up or sign in to vote.

Solution 2

Try this:
ModalPopupExtender ModalPopupExtender1 = new ModalPopupExtender();
ModalPopupExtender1.TargetControlID = Hyperlink1.ClientID; 
// Here you can set directly ID also.
//Now show your Model Popup.


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

  Print Answers RSS
0 Maciej Los 570
1 OriginalGriff 515
2 Sergey Alexandrovich Kryukov 460
3 Andy Lanng 209
4 CPallini 195
0 OriginalGriff 8,519
1 Sergey Alexandrovich Kryukov 7,667
2 CPallini 4,987
3 Maciej Los 4,686
4 Mika Wendelius 3,566

Advertise | Privacy | Mobile
Web02 | 2.8.150819.1 | Last Updated 4 Aug 2012
Copyright © CodeProject, 1999-2015
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100