This is a migrated thread and some comments may be shown as answers.

Clicking an appointment open a new window

3 Answers 142 Views
Calendar
This is a migrated thread and some comments may be shown as answers.
Jay
Top achievements
Rank 1
Jay asked on 01 May 2013, 09:27 PM
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?

3 Answers, 1 is accepted

Sort by
0
Shinu
Top achievements
Rank 2
answered on 02 May 2013, 07:42 AM
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.
0
Jay
Top achievements
Rank 1
answered on 02 May 2013, 05:57 PM
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!
0
Shinu
Top achievements
Rank 2
answered on 03 May 2013, 04:21 AM
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.
Tags
Calendar
Asked by
Jay
Top achievements
Rank 1
Answers by
Shinu
Top achievements
Rank 2
Jay
Top achievements
Rank 1
Share this question
or