Showing posts with label SharePoint 2010. Show all posts
Showing posts with label SharePoint 2010. Show all posts

Thursday, January 3, 2013

Hide Sign in as Different User in SharePoint 2010


Hide sign in as Different User action on welcome menu using customization of welcome control


Open WelCome.ascx file in visual studio. you found this file in controltemplates folder. We want to show only sign out option for welcome menu. Remove menu templates as per your required and save as "Custom_Welcome.ascx"


<%@ 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" %> <%@ Import Namespace="Microsoft.SharePoint" %> <%@ Assembly Name="Microsoft.Web.CommandUI, Version=14.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c" %><%@ Control Language="C#" Inherits="Microsoft.SharePoint.WebControls.Welcome,Microsoft.SharePoint,Version=14.0.0.0,Culture=neutral,PublicKeyToken=71e9bce111e9429c"   AutoEventWireup="false" compilationMode="Always" %>  <SharePoint:PersonalActions accesskey="<%$Resources:wss,personalactions_menu_ak%>" ToolTip="<%$Resources:wss,open_menu%>" runat="server" id="ExplicitLogout" Visible="false"> <CustomTemplate> <SharePoint:FeatureMenuTemplate runat="server" FeatureScope="Site" Location="Microsoft.SharePoint.StandardMenu" GroupId="PersonalActions" id="ID_PersonalActionMenu" UseShortId="true" > <SharePoint:MenuItemTemplate runat="server" id="ID_Logout" Text="<%$Resources:wss,personalactions_logout%>" Description="<%$Resources:wss,personalactions_logoutdescription%>" MenuGroupId="200" Sequence="300" UseShortId="true" />   </SharePoint:FeatureMenuTemplate> </CustomTemplate></SharePoint:PersonalActions><SharePoint:ApplicationPageLink runat="server" id="ExplicitLogin" ApplicationPageFileName="Authenticate.aspx" AppendCurrentPageUrl="true" Text="<%$Resources:wss,login_pagetitle%>" style="display:none" Visible="false" />



Open site master page on page search for register tag of  welcome control

<%@ Register TagPrefix="wssuc" TagName="Welcome" src="~/_controltemplates/Welcome.ascx" %>
replace with src="~/_controltemplates/Custom_Welcome.ascx" %>

Refresh the page and get happy...

Wednesday, February 1, 2012

Modal Dialog in SharePoint 2010

Modal dialog is new feature provided by SharePoint 2010. SharePoint 2010 uses modal dialog box for add and update items, perform administrator tasks without redirect current page.


To use modal dialog box you have to include client library SP.UI.ModalDialog. syntax for calling modal dialog box is shown below

SP.UI.ModalDialog.showModalDialog({
    url: "Url Of Page",
    title: "Title of Page",
    allowMaximize: true/false,
    showClose: true/false,
    width: in pixel e.g 800,
    height: in pixel e.g 600,
    dialogReturnValueCallback: callbackfunction
    });

Modal dialog box also takes SP.UI.DialogOptions as optional structure, syntax with structure is shown below

var Dialogoptions = SP.UI.$create_DialogOptions();

options.title = "PageTitle";
options.width = 600;
options.height = 800;
options.url = "PageUrl";
dialogReturnValueCallback: callbackfunction ;

SP.UI.ModalDialog.showModalDialog(options);

or you send options using simple generic object 

var genericoptions = {
    title: "PageTitle";,
    width: 800,
    height: 600,
   dialogReturnValueCallback: callbackfunction ,
    url: "PageUrl";};

SP.UI.ModalDialog.showModalDialog(options);


//Call back function syntax
function callbackfunction (dialogResult, returnValue) {

 } 



Start With MVC Application Part 1

Before we starting to create MVC Application we required customer table on which we create our application. So first create customer table...