Want to show button on ClientTransferred event. Not working in ie!

2 posts, 0 answers
  1. fred williams
    fred williams avatar
    55 posts
    Member since:
    Feb 2010

    Posted 25 Mar 2011 Link to this post

    So I've written some javascript code that should display a button when the listbox's OnClientTransferred event fires. It works fine in Chrome and Firefox but not IE (big surprise). I am using an asp:update panel so I'll post THE JavaScript and all of the relevant markup in case that matters.

    function showButton(){
         var btn = document.getElementById('<%=btnClientCont.ClientID%>');
         btn.style.display = "inherit";
    }

    and the markup

    <div>
    <asp:UpdatePanel ID="updatepanel" runat="server"><ContentTemplate>
    <table><tr><td>
    <telerik:RadListBox runat="server" ID="lstBox" OnClientTransferred="showButton">
    </telerik:RadListBox>
    </td></tr>
    <tr><td><telerik:RadListBox></telerik:RadListBox></td>
    <tr><td><asp:Button ID="btnReset" OnClick="rebindAll"/></td></tr>
    </ContentTemplate><Triggers><asp:AsyncPostBackTrigger ControlID="btnReset" EventName="Click"/>
    <asp:PostBackTrigger ControlID="btnClientCont"/></Triggers></asp:UpdatePanel></div>
    <div><input type="submit" runat="server" onservercick="btnContinue_Click" id="btnClientCont"/></div>

    Again, this works in both Chrome and Firefox, but the button won't appear in IE (tested on both 8 and 9).
  2. Dimitar Terziev
    Admin
    Dimitar Terziev avatar
    1266 posts

    Posted 31 Mar 2011 Link to this post

    Hi Fred ,

    We noticed in the provided code that this submit button is visible. In order to make it invisible you should add the following style in it's declaration:

    style="visibility:hidden"
     
    Once the submit button is invisible upon the page load, you should modify your showButton javascript function in the following way:

    function showButton() {
        var btn = document.getElementById('<%=btnClientCont.ClientID%>');
        btn.style.display = "block";
        btn.style.visibility = "visible";
         
    }

    This approach has been tested both in IE8 and IE7.

    All the best,
    Dimitar Terziev
    the Telerik team
  3. UI for ASP.NET Ajax is Ready for VS 2017
Back to Top