search envelope-o feed check
Home Unanswered Active Tags New Question
user comment-o

Response.Redirect in Context Menu in .NET 4.5

Asked by Stephanie
8 years ago.

I am hoping to get some help here....

We are being forced by some of our integrated apps to update to .NET 4.5 and having a few issues with our DayPilot Calendars. We have a context menu that shows when you click on an event on the calendar. That postsback and one of the items does a Response.Redirect to another page. That Response.Redirect no longer works because our calendar is in an UpdatePanel.....

If we remove the updatepanel then other items do not work....any ideas?

Comment posted by Stephanie
8 years ago.

OR is there a way to use the Navigate url and put in a url for the menu that is different for each event?

Answer posted by Dan Letecky [DayPilot]
8 years ago.

There are two options:

1. Use JavaScript to redirect it on the client side:

<DayPilot:MenuItem Text="Open" Action="JavaScript" JavaScript="document.location.href='Detail.aspx?id=' + e.id()" ></DayPilot:MenuItem>

2. Use NavigateUrl and use "{0}" as a placeholder for the event id. This only works for the id:

<DayPilot:MenuItem Action="NavigateUrl" NavigateUrl="Detail.aspx?id={0}" Text="Open" />
Comment posted by Stephanie
8 years ago.

Okay thanks, but we have an event scheduled for a client and have been allowing a 'Navigate to client page' in the menu so the id we need for the client is not the event id. I suppose we could grab the right client on that page from the event id, but I am just getting into this and I think there will be other places this will be an issue where that may not be so simple...

Comment posted by Dan Letecky [DayPilot]
8 years ago.

You can add the required data (client id) to event tags using DataTagFields="client_id" and access it using e.tag("client_id") in the menu item. The "client_id" field must be in the data source, of course.

Comment posted by Stephanie
8 years ago.

Thanks. I have not tried that yet as I am facing other issues in other places related to the Calendar controls and .NET 4.5 For instance I cannot call Response.Redirect in "protected void DayPilot1_EventClick(object sender, EventClickEventArgs e)".

An article I found says that you can add the control as a Trigger of the Update panel and that seems to work for regular button controls, etc. I was able to get that to work for the DayPilot control as well. So I think that may work.''

Thanks for the help

This question is more than 1 months old and has been closed. Please create a new question if you have anything to add.