The content you're reading is getting on in years
This post is on the older side and its content may be out of date.
Be sure to visit our blogs homepage for our latest news, updates and information.
In this post I'll explain how to create a functionality that will let you access the edit mode of the page while browsing. I'll also provide you with the code you'll need to implement this.
If you've paid attention to the url while in edit mode of a page, you may have noticed that the url is exactly the same as the url of page when it's not in edit mode, with one important exception. Namely, querystring „cmspagemode=edit“ is appended to the url. So, to achieve our desired functionality, we simply need to create a link that will point to page itself and add that querystring at the end.
While there is truly many different ways you can do this, we’ll go with the simplest one. We’ll create a user control that will consist only of one HyperLink control. The text of that HyperLink we’ll set to “Edit this page”. In the Page_Load method of that page we’ll set the url of the link to the current url plus the querystring for edit mode.
Also, because we don’t want this link to be visible to anyone browsing our page, we’ll make it visible only to authenticated users with the permission to modify the page in question.
And that’s it. While this, I believe, is a neat trick, it’s only a trick. In Sitefinity 4.0 (see roadmap) a robust and streamlined “browse-and-edit” feature will be implemented in Sitefinity.
View all posts from The Progress Team on the Progress blog. Connect with us about all things application development and deployment, data integration and digital business.
Let our experts teach you how to use Sitefinity's best-in-class features to deliver compelling digital experiences.
Learn MoreSubscribe to get all the news, info and tutorials you need to build better business apps and sites
Progress collects the Personal Information set out in our Privacy Policy and the Supplemental Privacy notice for residents of California and other US States and uses it for the purposes stated in that policy.
You can also ask us not to share your Personal Information to third parties here: Do Not Sell or Share My Info
We see that you have already chosen to receive marketing materials from us. If you wish to change this at any time you may do so by clicking here.
Thank you for your continued interest in Progress. Based on either your previous activity on our websites or our ongoing relationship, we will keep you updated on our products, solutions, services, company news and events. If you decide that you want to be removed from our mailing lists at any time, you can change your contact preferences by clicking here.