locked
hovermenuextender and callbacks RRS feed

  • Question

  • User-484217055 posted

    Hi gang

    I have a gridview with hovermenuextender in each row - thats all working quite good...

    but im missing something... 

    I need a callback when the popup panel becomes visible (prefered method)

    is this possible?

    thanks

    Wednesday, March 25, 2015 5:39 PM

Answers

  • User-484217055 posted

    Actually there is a way around this...

    if you make a linkbutton and provide both commandname and onClientClick it seems to fire both the href (which provides the postback) and the onClick which execute the script.

    so you can do something like this:

    <asp:LinkButton id="btnTest" runat="server" Text="test" CommandName="test" CommandArgument="test" OnClientClick="javascript:window.open('http://path.local.domain','_blank','toolbar=no');return true;" />

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Thursday, March 26, 2015 8:25 AM

All replies

  • User1711366110 posted

    but im missing something... I need a callback when the popup panel becomes visible (prefered method)

      As per this case, Post your corresponding code.
    for more information, refer the following links :

    1. http://www.codeproject.com/Tips/711023/GridView-with-HoverMenuExtender

    2. http://www.c-sharpcorner.com/UploadFile/raj1979/how-to-use-ajax-hovermenuextender-control-using-grid-view/

    --
    with regards,
    Edwin

    Thursday, March 26, 2015 5:29 AM
  • User-484217055 posted

    Thanks for the answer, but i cant show a working code (its too complex) but i can show some bits:

    <asp:Panel ID="popupMenu" runat="server" style="display:none">
    <div class="popupmenu">
    <div class="header">Menu</div>
    <div><asp:hyperLink ID="lnkNewServer" runat="server" Text="New Hostname" Visible="true" NavigateUrl="~/Host.aspx?Mode=NewHost" Target="_blank" /></div>
    <div><asp:hyperLink ID="lnkNewINumber" runat="server" Text="New I-Number" Visible="true" NavigateUrl="~/Host.aspx?Mode=NewINumber" Target="_blank" /></div>
    <hr />
    <div><asp:hyperLink ID="lnkSecurityOverview" runat="server" Text="Security Overview" Visible="true" NavigateUrl="~/SecurityOverview.aspx" Target="_blank" /></div>
    </div>
    </asp:Panel>
    <act:HoverMenuExtender ID="hoverMenu" runat="server"
    PopupPosition="Left"
    HoverCssClass="newmenuhover"
    PopDelay="50" />

    The hoverMenu.TargetControlID and PopupControlID is set on gridview_RowCreated

    As i said, this is working fine...

    The links or buttons or what ever i have in the menu panel (popupMenu) needs to open a new window, but i also need a call back to the original page to do some last stuff security validation.

    I could do the security validation when the the panel was shown, or when the user clicked the button - but im loosing the "new window" feature if i use LinkButton and generate the url server side. Using the Hyperlink im missing the callback. So i was hoping there was a hideen feature somewhere that would cause a callback when the panel was shown..

    Does this make any sence?

    /Stig

    Thursday, March 26, 2015 5:45 AM
  • User-484217055 posted

    Actually there is a way around this...

    if you make a linkbutton and provide both commandname and onClientClick it seems to fire both the href (which provides the postback) and the onClick which execute the script.

    so you can do something like this:

    <asp:LinkButton id="btnTest" runat="server" Text="test" CommandName="test" CommandArgument="test" OnClientClick="javascript:window.open('http://path.local.domain','_blank','toolbar=no');return true;" />

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Thursday, March 26, 2015 8:25 AM