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

Vote:
 

Hi!

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

#58435
Apr 25, 2012 12:33
Vote:
 

Hi Markus,

Could you get the PageData of the parent before deleting and just redirect using the ID of the parent for example www.yoursite.com/cmspath/edit/default.aspx?id=parentid

Mark

#58475
Apr 26, 2012 11:42
Vote:
 

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...

Cheers!

#58517
Apr 27, 2012 12:43
Vote:
 

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:

window.top.location.href = '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.

#58533
Apr 27, 2012 15:21
Vote:
 

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.

Cheers!

#58538
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.