Clicking an appointment open a new window

4 posts, 0 answers
  1. Jay
    Jay avatar
    4 posts
    Member since:
    Feb 2013

    Posted 01 May 2013 Link to this post

    This could just be my lack of understanding about ASP.Net...

    I'm using the Calendar control. When someone clicks on an appointment, I want to open a new browser window to a certain URL which I dynamically construct.

    I can achieve this with Response.Redirect, but it won't open in a new window (this part is important for various reasons).
    Protected Sub r_scheduler_AppointmentClick(sender As Object, e As Telerik.Web.UI.SchedulerEventArgs) Handles r_scheduler.AppointmentClick
        Response.Redirect("http://www.google.com", False)
    End Sub

    So the above code works great (except it won't open in a new window).When I try to change it using various tricks to open links in a new window, nothing seems to work. E.g.
    Response.Write("<script>")
    Response.Write("window.open('http://www.google.com','_blank')")
    Response.Write("</script>")

    It seems like the event handler executes code server side while i need to execute code client-side, but I don't know how to achieve my goal. Am I approaching the problem in a crazy manner? Is there an easier way to make double-clicking appointments open a new window with an arbitrary URL?
  2. Shinu
    Shinu avatar
    17764 posts
    Member since:
    Mar 2007

    Posted 02 May 2013 Link to this post

    Hi,

    Following is the sample code that I tried to achieve your scenario.
    aspx:
    <telerik:RadScheduler ID="RadScheduler1" runat="server" OnClientAppointmentClick="OnClientAppointmentClick">
    </telerik:RadScheduler>
    JS:
    <script type="text/javascript">
      function OnClientAppointmentClick(sender, args) {
        window.radopen("", "RadWindow1");
      }
    </script>

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

    Posted 02 May 2013 Link to this post

    Do I need to include some code to get the 'radopen' method? My browser is complaining it doesn't exist, and I don't know where to get it.

    Either way, using just window.open works great too, so I appreciate your help!
  5. Shinu
    Shinu avatar
    17764 posts
    Member since:
    Mar 2007

    Posted 02 May 2013 Link to this post

    Hi,

    Make sure that you have RadWindowManager on the page.
    aspx:
    <telerik:RadWindowManager ID="RadWindowManager1" runat="server">
            <Windows>
                <telerik:RadWindow ID="RadWindow1" runat="server">    </telerik:RadWindow>
            </Windows>
    </telerik:RadWindowManager>

    Thanks,
    Shinu.
Back to Top