Last post Nov 24, 2014 04:35 AM by Kevin Shen - MSFT
Nov 18, 2014 09:01 AM|akera.moi|LINK
Is it possible to start an event with the hyperlink control?
For example, when I press the control I need to start a modalpopup.
I know you may suggest to use a linkbutton but I cannot as I need to start a protocol handler (in the registry) that only starts with a direct link through the hyperlink control.
So, in my mind it should be something to this effect:
<asp:Hyperlink ID="HyperLink1" runat="server" navigateurl="protocol:handlerpath" click="Hyperlink1">
Protected Sub Hyperlink1(ByVal sender as Object, byval e as system.web.ui.imageclickeventargs) handles hyperlink1.click
Eh, but of course that doesn't work :)
Using the targetcontrol for the popup control as a hyperlink renders the hyperlink useless (as it will only open the modal popup) and not go to the navigateurl.
Any input appreciated.
Nov 18, 2014 09:29 AM|A2H|LINK
Add dummy button in your HTML MarkUp like given below
<asp:Button ID="btnDummy" runat="server" Text="Edit" Style="display: none;" />
Assign it to your modalpopup extender
<asp:ModalPopupExtender ID="mpe" runat="server" DynamicServicePath="" Enabled="True"
PopupControlID="pnlPopup" BackgroundCssClass="modalBackground" TargetControlID="btnDummy">
And open the popup from codebehind like given below
Nov 18, 2014 09:42 AM|akera.moi|LINK
Thank you A2H- however hyperlinks do not raise events - so I was just using an example with the Sub as to what I would like to do.
Nov 24, 2014 04:35 AM|Kevin Shen - MSFT|LINK
I suggest that you can set a breakpoint on the hyperlinks ,check if it can be hit.