Virtual Happy Hour this month, Jun 28, we'll be getting a sneak preview at our soon to launch SaaS CMS!

Try our conversational search powered by Generative AI!

How do I redirect from one page to another in custom EditPanel in editmode?



We have created a custom EditPanel plugin used for a certain type of page. This contains functionality to clean up connections before deleting itself. The cleanup and delete part works fine, but when I am done I would like to redirect to the parent page of the deleted page, while in edit mode. Otherwise I get an exception - page does not exist, since I just deleted it.

Is there a nice way to access the page tree and set selectedItem or similar?

Thanks in advance :-)

/ Markus

Apr 25, 2012 12:33

Hi Markus,

Could you get the PageData of the parent before deleting and just redirect using the ID of the parent for example


Apr 26, 2012 11:42

Hi, Mark!

Thanks for your suggestion and this is actually what I am doing right now. The problem is that the editpage is in a IFrame so only that content is redirected. The menu is still showing the former (non existing page) as selected, which is a bit confusing. I guess I could place som script in the parent page to refresh the window outside the iframe, but I was hoping for a more Episerver way of doing this and less of a "ful-hack", as this would be called in sweden.

If no other solution comes up I will create new page, Redirector.aspx, that refreshes the outer frame with some script. If someone has done this before (refresh the page tree and show the correct selected page, I would really like to re-use your scripts...


Apr 27, 2012 12:43

I also needed to do this and having talked an old colleague at EPi we decided the only way to do it was from the client in Javascript: = 'Default.aspx?id=<%=ParentPageId%>'

This worked fine for us as it was executed on a button click, not sure what you would use as trigger here though.

Apr 27, 2012 15:21

Thanks for your input, Paul,

I have created a page to redirect to, so that I can show a nice message. From this page I can run this script, will try this after the weekend.


Apr 27, 2012 16:25
This thread is locked and should be used for reference only. Please use the Episerver CMS 7 and earlier versions forum to open new discussions.
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.