When the OpenDialog method is invoked the SharePoint adds a div element named “ms-dlgContent”. The dialog contents are rendered from the passed URL. The passed URL can be a link to the web or a custom page. Also, the dialog can open a List Form dialog (Add/Edit). Another div element named “ms-dlgOverlay” disables the user from clicking on the original page and thus, provides the user with a modal dialog.
The showModalDialog method takes 1 parameter; an object of the Class SP.UI.DialogOptions. The option object contains the width and height of the dialog, the URL of the page and the dialog CallBack method name.
Step 1. JavaScript function
<scripttype="text/javascript">
function OpenDialog() {
var options= {
url:"/sitepages/myscustompage.aspx",
width: 800,
height: 600,
dialogReturnValueCallback: DialogCallback
};
SP.UI.ModalDialog.showModalDialog(options);
}
</script>
Step 2. Call javascript function on click of any button or any your control.
Since JavaScript is very useful tool for processing codeon Client Side, It saves lot of response time and becomes very efficient Following code extract is very useful in finding out currently logged In user in SharePointprogrammatically.
If you are running the Client Object Model (ClientOM) from javascript, then you should load the "sp.js" file using the ScriptLink.RegisterOnDemand method (a static method). In a web part, I recommend calling this in your OnPreRender override.
The script code that will call into the ClientOM must not run until the "sp.js" file is loaded. SharePoint provides a method to help with this and this method is part of init.js, meaning that you need not register any further script files from SharePoint. To run a method named Initialize, use the following call:
Introduction: Number of hurdles are faced while migrating a MOSS 2007 site to SharePoint 2010 site.
They can specially cumbersome if you are SharePoint novice. In this blog I have explained the walkthrough for migrating a MOSS 2007 site to SharePoint 2010 site.
Step1: Find the content database name of your site for doing
Step2: Go to "C:\Program Files\Microsoft SQL Server\MSSQL.1\MSSQL\Data\Your site database name" and Copy database files .mdf and .ldf . Before you copy these files please stop SQL services.
Or You could alternatively take contents db database backup (.bak) of MOSS2007 site using SQL Server Management Studio 2005.
Step3: Restore your MOSS2007 content database or Attach your database files (.mdf and .ldf) using SQL Server Management Studio 2008 r2 or create new database and restore .bak file.
Copy your MOSS2007 content database database files (.mdf and .ldf) in " C:\Program Files\Microsoft SQL Server\MSSQL10_50.MSSQLSERVER\MSSQL\DATA".
Open SQL Server Management Studio 2008 r2 and Enter credential.
Right Click on "Database" and select Attach option.
New window popsup then select ADD button.
Select your mdf and ldf files and press OK.
Now Your database is attached.
Step4: Create new Web Application on Share Point 2010.
Open Central Administration.
Select Application Management. Then Select "Manage Web Application" under Web Application section.
Select New from top ribbon bar.
Enter port number, web application name and press OK.
After creation of Web Application remove the Content Database from the new web Application. Go to "Central Administration" then Click on "Manage Content Database"
Select your web application and then Click on Database name.
After open the content database setting page, change Database Status "Ready" to "offline".
Check "Remove Content Database" option.
After checking this option you get on popup and select "OK" then click on "OK".
Step5: Now use STSADM to add MOSS 2007 content db to this web application. I am using the Microsoft "Share Point 2010 Management Shell" follow following links,
Open Share Point 2010 Management Shell -Start ->> All Programs ->> Microsoft Share Point 2010 Products ->> Share Point 2010 Management Shell.
Step7: If your old database version and new database version are same then your database successfully attached if not then you can get following error.
Step8: Then go to your SQL Server management studio and Type following query for updating version of your database.Use suggested verion by screen or higher .