To give some background for beginners, whenever we click Edit Page on Site Actions menu,the pages switches into a different display mode called Design Mode. Its not a feature ofSharepoint, but ASP.NET 2.0 Webparts Framework.
example, to programmatically switch the current page into design mode,
you can simply add a link control with an event handler that sets the DisplayMode property to DesignDisplayMode.
WebPartManager1.DisplayMode = WebPartManager.DesignDisplayMode;
This would be present in default.master. If we open Site Actions menu and do the View Source on IE.Here is the code of our interest :
As you must have figured out, its the MSOLayout_ToggleLayoutMode()
function which does all the magic of turning the current page into Edit
WebPartManager1.DisplayMode = WebPartManager.DesignDisplayMode;//(This can also be demonstrated, but its beyond scope)
Armed with this knowledge, we can build a simple webcontrol which we will switch the page into Edit mode and vice versa.Below is the code for the same. Its the simplest webcontrol you will see ever.
useful articles on sharepoint =) i'm sure they will be of immense help to newbees as well those that crack their heads over F1 .
keep up the good work!
im the first one to post on your new blog =)
Thx for good feedback ... I will surely keep it up ... :)
Awesome article dude. Gave me exactly what i was looking for.
Can we have something like igoogle in sharepoint?
User can choose from a list of webpart to drag and drop in the webpart zones which will be visible without clicking edit.
Incorporating exact functionality like igoogle in sharepoint is not easy due to several AJAX limitations. Although, you can achieve very close to it.
A very informative Post i must say.
When I write document.forms.onsubmit in a webcontrol's ascx on a sharepoint page if is fired.
But when I have a sharepoint site under PWA(Project web access) and on a page of such a site I have this webcontrol, then in such a case
document.forms.onsubmit does not get fired.
I am unable to get the root cause of this problem.
Waiting for your reply.
pls if anybody know this,this is my login pls respond me email@example.com