Google search results.

4 posts, 1 answers
  1. Merin
    Merin avatar
    14 posts
    Member since:
    Jul 2013

    Posted 05 Aug 2013 Link to this post

    Hi

    My scenario. I have few links button in my page. On Clicking these buttons, I want to display the corresponding search results from Google in a radwindow. I was not even able to open Google within a radwindow. What should I do?

    Thankyou
    Merin.
  2. Answer
    Shinu
    Shinu avatar
    17764 posts
    Member since:
    Mar 2007

    Posted 06 Aug 2013 Link to this post

    Hi Merin,

    Google cannot be opened in a RadWindow because Google is sending an "X-Frame-Options: SAMEORIGIN" response header. This option prevents the browser from displaying iFrames that are not hosted on the same domain as the parent page. One suggestion is instead of Google you can use Microsoft Bing to display the corresponding search results as shown in the following sample code.

    ASPX:
    <telerik:RadWindowManager ID="RadWindowManager1" runat="server">
    </telerik:RadWindowManager>
    <telerik:RadButton ID="lnkButton1" runat="server" ButtonType="LinkButton" Text="Telerik"
        AutoPostBack="false" OnClientClicked="search">
    </telerik:RadButton>
    <telerik:RadButton ID="lnkButton2" runat="server" ButtonType="LinkButton" Text="ASP"
        AutoPostBack="false" OnClientClicked="search">
    </telerik:RadButton>
    <telerik:RadButton ID="lnkButton3" runat="server" ButtonType="LinkButton" Text="Windows8"
        AutoPostBack="false" OnClientClicked="search">
    </telerik:RadButton>

    JavaScript:
    <script type="text/javascript">
        function search(sender, args) {
            var searchString = sender.get_text();
            radopen("http://www.bing.com/search?q=" + searchString, "RadWindowSearch");
        }
    </script>

    Thanks,
    Shinu.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Merin
    Merin avatar
    14 posts
    Member since:
    Jul 2013

    Posted 25 Sep 2013 Link to this post

    Shinu. I am creating and opening a window in js using window.radopen(). To that window displayed how can I close it on ESC key press?
  5. Shinu
    Shinu avatar
    17764 posts
    Member since:
    Mar 2007

    Posted 25 Sep 2013 Link to this post

    Hi Merin,

    Assign the window object to a JavaScript variable and use the addShortcut() client method to add a desired command. Please have a look into the following sample code.

    JavaScript:
    <script type="text/javascript">
        function openRadWindow(sender, args) {
            var oWindow = window.radopen("http://www.telerik.com", null);
            oWindow.addShortcut("Close", "Esc");
        }
    </script>

    Thanks,
    Shinu.
Back to Top