Friday, 24 June 2011

How to Display Active Directory User details inculding Expiry Date

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.DirectoryServices;
using Microsoft.VisualBasic;

namespace AD
{
    class Program
    {
          
        static public void Main(string[] args)
        {
            string username = "testuser1";
            DirectoryEntry user = new DirectoryEntry("LDAP://CN=" + username + "," + " OU= Web Users,DC=CGSTAGE,DC=com", null, null, AuthenticationTypes.Secure);
           
            // GetInt64 is used to conver system._comObject to 64bit integer
            DateTime expires = DateTime.FromFileTime(GetInt64(user, "accountExpires"));
          
            Console.WriteLine(expires.ToString());

            Console.WriteLine("Display Name "+user.Properties["displayName"].Value.ToString());
            Console.WriteLine("First Name "+user.Properties["givenName"].Value.ToString());
            Console.WriteLine("Last Name "+user.Properties["sn"].Value.ToString());
            Console.WriteLine("Mail ID "+user.Properties["mail"].Value.ToString());


            Console.ReadKey();

        }

           
        static public Int64 GetInt64(DirectoryEntry entry, string attr)
        {           
            DirectorySearcher ds = new DirectorySearcher(
                entry,
                String.Format("({0}=*)", attr),
                new string[] { attr },
                SearchScope.Base
                );

            SearchResult sr = ds.FindOne();

            if (sr != null)
            {
                if (sr.Properties.Contains(attr))
                {
                    return (Int64)sr.Properties[attr][0];
                }
            }
            return -1;
        }

    }
}

Thursday, 23 June 2011

How to read the Roles and Groups names from a web application- program

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.SharePoint;


namespace consolechk
{
    class Program
    {
        static void Main(string[] args)
        {
            SPSite site1 = new SPSite("http://stage2008:5678/");
            SPWeb web = site1.OpenWeb();
            SPGroupCollection groupcoll = web.Groups;
            foreach (SPGroup group in groupcoll)
             {
                  System.Console.WriteLine(group.Name.ToString());
             }

              Console.WriteLine();
              Console.WriteLine();
              SPRoleCollection rolecoll = web.Roles;
           foreach (SPRole role in rolecoll)
            {
                Console.WriteLine(role.Name.ToString());
            }

            System.Console.ReadLine();
        }
    }
}

Creating Custom Content Types with Code for SharePoint 2010

Creating content types is one of the fundamental features of SharePoint, and although you can create your own content types through the user interface of SharePoint, I’d like to show you a couple options on how you can create your own content types using code. I am going to jump right in, so if you need a refresher on what content types are, please review Kelly Rusk’s article on content types.
Option 1: Custom Content Types (via a Content Type project)
The first (and probably the easiest) way to create a custom content type is to use Visual Studio 2010 to create a special project type of type Content Type. I’m going to create a custom content type named MovieData, which will have a choice column that will allow selection of a movie genre, when creating/uploading a document.
Launch Visual Studio 2010 and create a new project. Click on the installed project templates to display the templates in the SharePoint 2010 section, and select the template named Content Type. Give the project the name MovieData and click the OK button.

The SharePoint Customization Wizard opens, which will display a series of steps you need to provide information for, so Visual Studio can configure your project properly. On the first screen, enter the URL of the SharePoint site you want this content type to be deployed to. You should also select the Deploy as a farm solution radio button. Press the Next button to continue.

The next screen requires that you choose which content type to inherit the content type from. We want to inherit from the Document content type, so select Document from the dropdown list, and press the Finish button. Visual Studio will now create the project, and we are ready to finish coding our custom content type.

You will notice that for the Content Type project template, Visual Studio creates an elements.xml file as part of the project. This is the only file we will need to modify to complete our custom content type. Open the elements.xml file, and under the ContentType node, set the Name attribute to ‘MovieData’. You can optionally set the Description attribute value to whatever you like, and if you wish to have the content type be displayed in a specific content type group, you can modify the Group attribute value. Note that the ID attribute value represents the GUID value of the content type we inherited from (the Document content type).

The next step is to create the Genre column that will be part of our MovieData content type. To do this, add a Field element inside the Elements node, right before the ContentType node. Set the Name and DisplayName attribute values to ‘Genre’, and make the column a choice column by setting the Type attribute to ‘Choice’. You also need to give the field a unique ID value (a GUID), which you can use the GUIDGEN tool to do this for you.
Since the column we are adding is a choice column, we now need to add entries that will be displayed when the user is selecting an entry. Add a CHOICES node inside the Field element, and then add one or more CHOICE nodes inside the CHOICES node.

Once you have this column defined, you must add a field reference so the column can be displayed as part of the content type. Add a FieldRef element inside of the FieldRefs node, as seen here:

Make sure you use the same GUID that you created when you created the Field element, and give the Name and DisplayName attributes a value of ‘Genre’. Save the elements.xml file when you are finished.
The project is now ready to be compiled and deployed to our SharePoint site. Right mouse click the project in Solution Explorer, and select Deploy. Visual Studio will compile the project, deploy the content type (as a Feature), and automatically activate it at the site level.


At this point, our custom content type is ready to use, but first we need to enable it in the document library that we want to use it in. I have created a normal document library in my SharePoint site named Movies. Navigate to the Document Library Settings page, and click on Advanced Settings. Enable management of content types, and click OK. This allows us to add our content type for this document library, so we can classify documents with this content type.

When you return to the Document Library Settings page, you will notice that under the Content Types section, there is the Add from existing site content types link. Click on this link to add our MovieData custom content type to this library.


I have also specified that our MovieData content type is the default content type by making it the first in the list of content types (selecting ‘1’ in the Position from Top selection), under the Change new button order and default content type link. Click OK when finished.

That’s it! We are now ready to upload (or create) a document to our library, and our content type will be used when uploading/creating the document. You will notice that a dialog is displayed when I upload a document, allowing selection of a Genre metadata field when uploading the document.

Option 2: Custom Content Types (via a blank SharePoint project)
The second way to create a custom content type is to do it with SharePoint object model code. The code will be deployed as a feature also, but the content type will be created when the feature is activated. This has the advantage that if you need to do anything custom to your content type before it gets created, you can handle that with code.
I am going to create the same MovieData content type that I created in Option 1, so you can see the differences in how the content type is created.
Launch Visual Studio 2010 and create a new project. Click on the installed project templates to display the templates in the SharePoint 2010 section, and select the template named Empty SharePoint Project. Give the project the name MovieData and click the OK button. You will notice that Visual Studio only asks you to specify whether the project should be deployed in a farm or sandbox solution (select the farm solution). Visual Studio doesn’t ask you for any additional information when creating the project, as it did in Option 1. An empty SharePoint project assumes you will handle all the configurations yourself.
The next step is to create a feature, as this is how we will deploy our custom content type. Right mouse click the Features node in Solution Explorer, and click on Add Feature. This will create a feature in the project and open the designer page for the Feature1.feature file. We want to add code to the events that fire when the feature is activated/deactivated, so in order to do that we need to add an event receiver to the feature. Right mouse click the Feature1.feature file in Solution Explorer, and click on Add Event Receiver:

Visual Studio creates a Feature1.EventReceiver.cs file, which contains the event handlers for the FeatureActivated, FeatureDeactivating, FeatureInstalled, FeatureUninstalling, and FeatureUpgrading events. We are only going to add code to the FeatureActivated and FeatureDeactivating events. Uncomment the FeatureActivated event, and add the following code snippet:
SPWeb thisWeb = (SPWeb)properties.Feature.Parent;
thisWeb.AllowUnsafeUpdates = true;  SPContentTypeCollection contentTypes = thisWeb.ContentTypes;
SPContentType parent = thisWeb.ContentTypes["Document"];
SPContentTypeId parentID = parent.Id;
SPContentType MovieDataCT = new SPContentType(contentTypes[parentID], contentTypes, “MovieData”);
contentTypes.Add(MovieDataCT);
string GenreField = thisWeb.Fields.Add(“Genre”, SPFieldType.Choice, false);
SPFieldChoice genre = (SPFieldChoice)thisWeb.Fields.GetFieldByInternalName(GenreField);
genre.Choices.Add(“Comedy”);
genre.Choices.Add(“Documentary”);
genre.Choices.Add(“Drama”);
genre.Choices.Add(“Science Fiction”);
genre.Choices.Add(“Western”);
genre.Update();
SPFieldLink genreLink = new SPFieldLink(genre);
MovieDataCT.FieldLinks.Add(genreLink);
MovieDataCT.Update();
SPList MovieList = thisWeb.Lists["Movies"];
MovieList.ContentTypesEnabled = true;
MovieList.Update();
MovieList.ContentTypes.Add(MovieDataCT);
MovieList.Update();
SPContentTypeCollection listCTs = MovieList.ContentTypes;
System.Collections.Generic.IList newOrder = new System.Collections.Generic.List();
newOrder.Add(listCTs["MovieData"]);
newOrder.Add(listCTs["Document"]);
MovieList.RootFolder.UniqueContentTypeOrder = newOrder;
MovieList.RootFolder.Update();
This code will execute when the feature is activated, and is responsible for all the steps of creating our custom content type. Let’s go through each area of the code.
SPWeb thisWeb = (SPWeb)properties.Feature.Parent;
thisWeb.AllowUnsafeUpdates = true;  SPContentTypeCollection contentTypes = thisWeb.ContentTypes;
SPContentType parent = thisWeb.ContentTypes["Document"];
SPContentTypeId parentID = parent.Id;
SPContentType MovieDataCT = new SPContentType(contentTypes[parentID], contentTypes, “MovieData”);
contentTypes.Add(MovieDataCT);
The first thing the code does is get a reference to the SharePoint site and set the AllowUnsafeUpdates property, so we can modify the site through code. We then need to reference the Document content type defined, so we can create our custom content type, inheriting from the Document content type. Once we have this, we then create our new content type called MovieData, and add it to the content type collection defined for our SharePoint site.
SPWeb thisWeb = (SPWeb)properties.Feature.Parent;
string GenreField = thisWeb.Fields.Add(“Genre”, SPFieldType.Choice, false);
SPFieldChoice genre = (SPFieldChoice)thisWeb.Fields.GetFieldByInternalName(GenreField);
genre.Choices.Add(“Comedy”);
genre.Choices.Add(“Documentary”);
genre.Choices.Add(“Drama”);
genre.Choices.Add(“Science Fiction”);
genre.Choices.Add(“Western”);
genre.Update();
The next step is to create the Genre site column that is part of our MovieData content type. This will be a Choice column, so we will instantiate a variable of type SPFieldChoice class to create the column of the proper type. We also need to add some choices to be available, and then finally calling Update() will create the site column on the SharePoint site.
Once the site column is created, we need to link it to our content type. This is done with a SPFieldLink class, specifying the site column to link. The code adds this to the FieldLinks collection of our content type, and then calling Update() on our content type actually creates the custom content type on the SharePoint site.
SPWeb thisWeb = (SPWeb)properties.Feature.Parent;
SPList MovieList = thisWeb.Lists["Movies"];
MovieList.ContentTypesEnabled = true;
MovieList.Update();
MovieList.ContentTypes.Add(MovieDataCT);
MovieList.Update();
Now that our content type has been created, we can now use it in our Movies document library. In order to do this, the code first makes sure that content type management is enabled for our document library, and then adds the content type to the document library. Note that we need the call to the Update() method after setting the ContentTypesEnabled flag to true. If we omit this, then adding the content type to our document library would throw an exception, as content type management has not been enabled.
SPWeb thisWeb = (SPWeb)properties.Feature.Parent;
SPContentTypeCollection listCTs = MovieList.ContentTypes;  System.Collections.Generic.IList newOrder = new System.Collections.Generic.List();
newOrder.Add(listCTs["MovieData"]);
newOrder.Add(listCTs["Document"]);
MovieList.RootFolder.UniqueContentTypeOrder = newOrder;
MovieList.RootFolder.Update();
The final step that the code takes is to set our MovieData content type as the default content type for the Movies document library. This is done by creating a generic list variable of type SPContentType, and adding the existing content types for our document library to it. What is important to remember here is the order in which the content types are listed in the generic list variable, as SharePoint considers the first content type in the list to be the default. The code builds this list and replaces the existing list in our document library by replacing the UniqueContentTypeOrder variable. Calling Update() on the RootFolder commits the changes back to SharePoint.
Since we are creating a content type when a feature is being activated, it makes good sense that we clean up after ourselves when the feature is deactivated. Uncomment the FeatureDeactivating event handler, and add the following code snippet:
SPWeb thisWeb = (SPWeb)properties.Feature.Parent;
thisWeb.AllowUnsafeUpdates = true;  SPContentTypeCollection contentTypes = thisWeb.ContentTypes;
SPContentType MovieDataCT = thisWeb.ContentTypes["MovieData"];
SPContentTypeId MovieDataCTID = MovieDataCT.Id;
SPList MovieList = thisWeb.Lists["Movies"];
SPContentTypeId listCTID = MovieList.ContentTypes["MovieData"].Id;
// Delete any list items of our content type first
foreach (SPListItem item in MovieList.Items)
{
if (item.ContentTypeId == listCTID)
item.Delete();
}
MovieList.ContentTypes["MovieData"].Delete();
MovieList.Update();
SPContentTypeCollection listCTs = MovieList.ContentTypes;
thisWeb.ContentTypes.Delete(MovieDataCTID);
thisWeb.Update();
thisWeb.Fields["Genre"].Delete();
thisWeb.Update();
This code snippet handles all the steps needed to remove the MovieData custom content type, as well as the Genre site column from our SharePoint site. Note that before the content type can be removed, the code goes through the Movies document library and deletes any documents that have been classified with our custom content type.
In conclusion, I’ve shown you two different options on how to create custom content types with code. The first option is the quickest way to accomplish this, and the second option gives you more control and flexibility, if you need to add any custom functionality or logic when implementing your custom content types.

Monday, 20 June 2011

Program to Create Active Directory user

1. Add refereces 
2. Create One Organization Unit in Active Directory Named Web Users
My Domain Name is CGSTAGE

using System;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.DirectoryServices;

namespace Custom_New_User.VisualWebPart1
{
    public partial class VisualWebPart1UserControl : UserControl
    {
        protected void Page_Load(object sender, EventArgs e)
          {
           }

        protected void btnSubmit_Click(object sender, EventArgs e)
        {

            try
            {
                DirectoryEntry parent = new DirectoryEntry("LDAP://OU= Web                 Users,DC=CGSTAGE,DC=com", null, null, AuthenticationTypes.Secure);
                DirectoryEntry user = parent.Children.Add("CN="+txtUName.Text, "user");
                using (user)
                {
                    //sAMAccountName is required for W2k AD, we would not use
                    //this for ADAM, however.
                    user.Properties["sAMAccountName"].Value = txtUName.Text;

                    //userPrincipalName is not required, but recommended
                    //for ADAM. AD also contains this, so we can use it.
                    user.Properties["userPrincipalName"].Value = txtUName.Text;
                    user.Properties["givenName"].Value = txtFName.Text;
                    user.Properties["sn"].Value = txtLName.Text;                  
                    user.CommitChanges();
                    //To Activate the User
                    int val = (int)user.Properties["userAccountControl"].Value;
                    user.Properties["userAccountControl"].Value = val & ~0x2;
                    user.Invoke("SetPassword", new object[] { txtPassword.Text });
                    user.CommitChanges();
                }

            }

            catch (Exception e1)
            {
                Label1.Text = e1.Message;
            }

        }
     }

    }

Custom Welcome Menu in Sharepoint 2010

How to edit the Welcome drop-down menu in Sharepoint 2010

Did you ever wanted to extend that user menu in Sharepoint, the one that states your name on the top right corner and drops down items such as “My Settings”, “Sign in as a Different User” and “Sign Out”? Well search no more as I will show you step by step on how to do that in Sharepoint Foundation 2010, this also works in older versions of Sharepoint (just take note, that where ever a folder location is stated refer to the folder version you are in). So lets start.

1. Create an Empty Sharepoint Project


You need Visual Studio 2010 to start with as well as well as the SDK for Sharepoint 2010, for a guide on how to install Sharepoint 2010 in a non server environment such as your development workstation please refer here. Once you have it properly installed go and create an empty Sharepoint Project.

2. Updating the Solution Feature


Now You will see all proper files are created for you to get started

We are interested on the Features section so double-click Feature1 and update the properties, make sure you change the scope to “WebApplication

3. Create an Element


Now you need to create an element to attach to your feature, to do that right-click on the project and add a new item, then choose “Empty Element“. Dont forget to give it a Name.

Once added verify by going to the Feature design or Manifest whether it had attached to the feature. If all is OK, edit your element to reflect what you needed (The additional menu item on the drop down menu), here is a sample code to create a “My Information” link which goes to a page in Sharepoint called “/SitePages/My%20Information.aspx”
<?xml version="1.0" encoding="utf-8"?>
<Elements xmlns="http://schemas.microsoft.com/sharepoint/">
  <CustomAction
        Id ="CustomMenu_MyInformation"
        GroupId="PersonalActions"
        Location="Microsoft.SharePoint.StandardMenu"
        Sequence="1000"
        Title="My Information"
        Description="View and Update my Information" 
        ImageUrl="_layouts/images/icon_contactlist.gif">
    <UrlAction Url="/SitePages/My%20Information.aspx"/>
  </CustomAction>
</Elements>
Now for a bit of explanation how did we get that code and what’s in there. In case you have been tinkering on how to edit the welcome drop-down menu item then you might have encountered posts in the net like from Ms Sharepoint Blog which talks about the file in C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\14\TEMPLATE\CONTROLTEMPLATES\Welcome.ascx, that is the file that controls how that drop down is rendered. If you open that file you might had noticed that there is a SharePoint:FeatureMenuTemplate Control under , and thats the control for the drop-down menu. You can directly add items to it but there’s no point as you cannot manually add a Navigate URL Element Directly, or even if you can once you upgraded Sharepoint then your customization will not be remembered.
Now in that SharePoint:FeatureMenuTemplate control there is a GroupId which is “PersonalActions“, that’s the GroupId that we need to override and create custom action hence the code above is pointed to the same GroupId, we also gave it the same Location as the SharePoint:FeatureMenuTemplate, and for the others I guess its self-explanatory.

4. Package your Sharepoint Solution

Once all satisfied on your custom menu all you need to do now is to package it. Right click on the Project or on the Menu bar Choose Build->Package.

Take note where the package is created on your Output window

Now copy that and place it on your Sharepoint Servers file system, I placed mine in C:\Package\

5. Add and Install your Solution to Sharepoint


First go to SharePoint 2010 Management Shell and type
Add-SPSolution C:\YourFolder\YourPackageName.wsp

Then verify whether it is uploaded correctly by going to “SharePoint 2010 Central Administration”. Navigate to System Settings -> Manage Farm Solutions

If your Package is there then it uploaded correctly, now click your package

Then Deploy Solution

It will warn you like such, just hit OK.
Another option is through Powershell you can type this command (doing this eliminates the last 3 steps)

Install-SPSolution -identity YourPackageName.wsp -WebApplication http://yoursharepointurl -GACDeployment

6. Now your menu item is ready, check it out

 Important Note

5.  From the step 5  this ways were not worked for me.

So follow the following way

Change the scope to Web level in the feature

Then click package.

Go to your website --> Site Settings --> Solutions ---> Upload the WSP file from project->bin->Debug  Choose the WSP File 

After the activate it

------Sugunthan Shanmuga Sundaram...................

Wednesday, 8 June 2011

How to create tab control using multview in sharepoint 2010

Please Copy and paste this code to your visual web part coding

<%@ Assembly Name="$SharePoint.Project.AssemblyFullName$" %>
<%@ Assembly Name="Microsoft.Web.CommandUI, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>
<%@ Register Tagprefix="SharePoint" Namespace="Microsoft.SharePoint.WebControls" Assembly="Microsoft.SharePoint, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>
<%@ Register Tagprefix="Utilities" Namespace="Microsoft.SharePoint.Utilities" Assembly="Microsoft.SharePoint, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>
<%@ Register Tagprefix="asp" Namespace="System.Web.UI" Assembly="System.Web.Extensions, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" %>
<%@ Import Namespace="Microsoft.SharePoint" %>
<%@ Register Tagprefix="WebPartPages" Namespace="Microsoft.SharePoint.WebPartPages" Assembly="Microsoft.SharePoint, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %>
<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="VisualWebPart1UserControl.ascx.cs" Inherits="Change_Search.VisualWebPart1.VisualWebPart1UserControl" %>
<style type="text/css">
       
    .linkStyle
    {
        background-image:url('../../../_layouts/images/Change%20Search/unselected.jpg');
        color:White;
        padding-top:12px;
        padding-left:15px;
        text-decoration:none;
       
        }
       
       .linkSelect
       {
              background-image:url('../../../_layouts/images/Change%20Search/sel.jpg');
        color:White;
        padding-top:12px;
        padding-left:15px;
        text-decoration:none;
       }
      
      .divStyle
      {
         
          width:600px;
          height:200px;
          background-color:#8055be;
          color:White;
          padding:0px;
         
      }
</style>

<div>
    Change Search<br />


    <asp:LinkButton ID="LinkButton1" runat="server" CssClass="linkSelect"
        Height="23px" Width="105px" onclick="LinkButton1_Click" ForeColor="White">One</asp:LinkButton>

    <asp:LinkButton ID="LinkButton2" runat="server" CssClass="linkStyle"
        Height="23px" Width="105px" onclick="LinkButton2_Click" ForeColor="White">Two</asp:LinkButton>
  

    <asp:LinkButton ID="LinkButton3" runat="server" CssClass="linkStyle"
        Height="23px" Width="105px" onclick="LinkButton3_Click" ForeColor="White">Three</asp:LinkButton>


  

<asp:MultiView
    ID="MultiView1"
    runat="server"
    ActiveViewIndex="0"  >
   <asp:View ID="Tab1" runat="server">
        <div class="divStyle">
          
           One Section
        </div>    

     </asp:View>
    <asp:View ID="Tab2" runat="server">
       
        <div class="divStyle">
     Two Section
        </div>
    </asp:View>
    <asp:View ID="Tab3" runat="server">
       
        <div class="divStyle">
       Three Section
        </div>      

    </asp:View>
</asp:MultiView>

</div>



This section for the code behind file

using System;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Linq;
using Microsoft.SharePoint;
using Microsoft.SharePoint.WebControls;
using Microsoft.SharePoint.Linq;

namespace Change_Search.VisualWebPart1
{
    public partial class VisualWebPart1UserControl : UserControl
    {
        protected void Page_Load(object sender, EventArgs e)
        {
        }

      

        protected void LinkButton1_Click(object sender, EventArgs e)
        {
            apply_unselect_style();
            LinkButton1.CssClass = "linkSelect";
            MultiView1.ActiveViewIndex = 0;
           
        }


        public void apply_unselect_style()
        {
            LinkButton1.CssClass = "linkStyle";
            LinkButton2.CssClass = "linkStyle";
            LinkButton3.CssClass = "linkStyle";


        }

        protected void LinkButton2_Click(object sender, EventArgs e)
        {

            apply_unselect_style();
            LinkButton2.CssClass = "linkSelect";
            MultiView1.ActiveViewIndex = 1;

        }

        protected void LinkButton3_Click(object sender, EventArgs e)
        {
            apply_unselect_style();
            LinkButton3.CssClass = "linkSelect";
            MultiView1.ActiveViewIndex = 2;
        }



        }

     

       

          
         
    }




How to Add Image to Sharepoint 2010 Visual Web part

  • 1- Open your Visual Web Part project
  • 2- Right click on the project name
  • 3- Point to “Add menu”
  • 4- And click on “SharePoint  Images Mapped Folder”

  • 5- Now you will have an “Image” folder and inside it you will have a sub folder named as your project name.
  • 6- Inside the sub folder you can add your images
  • 7- From your web part page “ascx” add an Image (HTML or Standard) control.
  • 8- In properties menu click on “Image URL” or “Src”
  • 9- A popup form will open “Select Image”
  • The image url as like this '~/_layouts/images/UserRoleVisualSugn/1696924227.png'

Tuesday, 7 June 2011

How to Add Footer in the v4.master

There are a few ways you could go when creating a footer that goes with v4.master. One simple method would be to add a div right before the DeveloperDashboard line in v4.master. Add the bolded line below:
<div class="s4-notdlg" style="clear: both; text-align: right; padding: 10px; background-color: #FCFCFC; border: 1px solid #DBDDDE;">
&copy; Copyright 2010 AdventureWorks, Inc.
</div>

<SharePoint:DeveloperDashboard runat="server"/>