open in new window

6 posts, 0 answers
  1. Sander Wijnen
    Sander  Wijnen avatar
    5 posts
    Member since:
    Mar 2010

    Posted 30 Jul 2011 Link to this post

    Hi,

    is there a way to open a new browser window when the user clicks on a ribbon button?
    Thnx.
  2. Kate
    Admin
    Kate avatar
    1898 posts

    Posted 02 Aug 2011 Link to this post

    Hi Sander Wijnen,

    You can use the OnClientButtonClicking client-side event and open a new window by applying the following javascript function (please take a look at this demo where the described approach is exemplified):

    function OnClientButtonClicking(sender, args) {
            window.open("http://www.telerik.com", "WindowPopup", "width=400px, height=400px, resizable");
                    }

    Best wishes,
    Kate
    the Telerik team

    Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.

  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Sander Wijnen
    Sander  Wijnen avatar
    5 posts
    Member since:
    Mar 2010

    Posted 05 Aug 2011 Link to this post

    How can I get the ID from the button to check if this is the button to start a new window?

    function

     

     

    OnClientButtonClicking(sender, args) {

     

    var button = args.get_button();

     

    var text = button.tostring;

    alert(text);

     

    if (text == "btnOpenWebsite") {

    window.open(

     

    http://www.telerik.com, "WindowPopup", "width=400px, height=400px, resizable");

    }

    }

  5. Kate
    Admin
    Kate avatar
    1898 posts

    Posted 05 Aug 2011 Link to this post

    Hello Sander,

    You can find a button by text using the following javascript function:

    <script type="text/javascript">
            function OnClientButtonClicking(sender, args) {
                var button = args.get_button();
                if (button.get_text() == "New") {
                    window.open("http://www.telerik.com", "WindowPopup", "width=400px, height=400px, resizable");
                }
            }
        </script>

    Regards,
    Kate
    the Telerik team

    Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.

  6. Sander Wijnen
    Sander  Wijnen avatar
    5 posts
    Member since:
    Mar 2010

    Posted 05 Aug 2011 Link to this post

    thnx, is there also an function to get the UniqueID ? because that's safer to use, with all the button texts.


  7. Kate
    Admin
    Kate avatar
    1898 posts

    Posted 08 Aug 2011 Link to this post

    Hi Sander ,

    We have not implemented such function but you can easily assign unique values to the buttons and use the get_value() client-side function in order to get the needed element.

    Best wishes,
    Kate
    the Telerik team

    Browse the vast support resources we have to jump start your development with RadControls for ASP.NET AJAX. See how to integrate our AJAX controls seamlessly in SharePoint 2007/2010 visiting our common SharePoint portal.

Back to Top
UI for ASP.NET Ajax is Ready for VS 2017