Add to Handler page to SharePoint 2013
http://mauricevanlieshout.wordpress.com/2013/03/18/sharepoint-webpart-call-to-ashx-handler/
Create Custom Ribbon Using SharePoint 2013
http://www.sharepoint-journey.com/custom-actions-in-sharepoint-2013.html
Execution Server Side Methods by Clicking on a DIV
$("#DivID").click(function () {
__doPostBack('__Page', 'DivID');
});
on page load add this code
if (Page.IsPostBack)
{
//you will get id of div which called function
string eventargs =Page.Request["__EVENTARGUMENT"];
if (!string.IsNullOrEmpty(eventargs))
{
BindDataToGrid();
}
}
Get sharepoint site ID using powershall
get-spsite | select Url,ID, RootWeb
Get site back in sharepoint 2013 using Powershall command
Backup-spsite http://trig161:200" -path "D:\Elavarasu\SiteBack.bak"
Restore site backup in sharepoint site
Restore-spsite "http://trig161:200" -path "D:\Elavarasu\SiteBack.bak" -force
-force ==over writte site collection
Add Solution to central admin using powershall cmd
add-spsolution "E:\sharepointWSP\petronash.wsp"
Single solution Retract & Remove
Uninstall-SPSolution -Identity <Solution name.wsp>
ex: Uninstall-SPSolution -Identity Solution.wsp
Remove-SPSolution -Identity <Solution name.wsp>
ex: Remove-SPSolution -Identity Solution.wsp
WEBPART PAGE LIFECYCLE
creating webpart contains various life cycle similar like ASP.net page lifecycle. but based on on your environment it will be differ:
OnInit – Configuration values set using WebBrowsable properties and those in web part task pane are loaded into the web part.
LoadViewState – The view state of the web part is populated over here.
CreateChildControls – All the controls specified are created and added to controls collection. When the page is being rendered for the first time the method generally occurs after the OnLoad() event. In case of postback, it is called before the OnLoad() event. We can make use of EnsureChildControls() – It checks to see if the CreateChildControls method has yet been called, and if it has not, calls it.
OnLoad User Generated Event – for e.g. button click on the web part.
OnPreRender – Here we can change any of the web part properties before the control output is drawn.
RenderContents – Html Output is generated.
SaveViewState - View state of the web part is serialized and saved.
Dispose -UnLoad.
No comments:
Post a Comment