Interview Questions administrator

Best SharePoint administrator Interview Questions and Answers with topic wise:


Recycle Bin | MMS | ManagedVsCrawledProperties |

Monday, September 17, 2012

BreadCrumb In SharePoint 2010


Breadcrumb in SharePoint:
I want to develop a breadcrumb that should have to show up the below structure.

                    Root Node-->Parent Node-->Current Node.

Approach 1:
I tried the use the existing SharePoint introduced breadcrumb.

Tuesday, September 4, 2012

Client side validation of ASPX server controls with Best example

This is a simple validation control at the client side using JavaScript.  Here we have to perform the server side controls validation at the client-side using JavaScript. In below “RadiobuttonList” is server control and we had to perform validation at the client-side first once button click operation performed.

Why need it /Use of it:
The button click operation will not continue/Perform if you select the  “No” option in the radiobuttonlist. For this reason, we have to perform client-side validations using JavaScript for Asp.net server controls.

<td>
 <div>
  <asp:RadioButtonList ID="radiobuttonList1"  
    CssClass=" radiobuttonList1class" RepeatDirection="Horizontal"
    RepeatColumns="2" runat="Server">
    <asp:ListItem Text="Yes" Value="1"  Selected="True" />
    <asp:ListItem Text="No" Value="0" />
   </asp:RadioButtonList>
 </div>
</td>
<td>                             
 <asp:Button ID="btnSubmit" Text="Submit" OnClientClick="return
  btnsubmit_OnClientClick();" OnClick="btnSubmit_OnClick" runat="server"/>
</td>

var flag = true;
    function btnsubmit_OnClientClick()  {
         if (Page_IsValid) //server-side validation
         {
            var IsRequest = false;
            var radioObj = document.getElementById("<%=rbNeedBBAccount.ClientID %>");
            var radioList = radioObj.getElementsByTagName('input');
            for (var i = 0; i < radioList.length; i++) {
                if (radioList[i].checked) {

                    if (radioList[i].value == 1) {
                        flag = true;
                    }
                    else {
                     alert("Ur Request for xx  can’t be processed, as Need for xx  account field is set to NO.");
                        flag = false;
                    }
                }
            }
        }
        return flag;
    }

Note:
  1. If you are using more than one Validation Groups in page, so you need to explicitly specify the group.
  2. Best reference URL for Asp.Net Validation using JavaScript:
    1. http://praveenbattula.blogspot.in/2009/10/client-side-validation-of-aspx.html

Wednesday, August 29, 2012

Adding/Removing users to/from the group:

Note: We have to check before adding/removing users to/from the group and also check the users already exists or not in group. 
 
public void AddDeleteUsersInGroup(User user)
        {
            string GroupName = string.Empty;
            if (user.IsAdmin.HasValue && user.IsAdmin.Value)
                GroupName = "Group Owners";
            else if (user.IsApprover.HasValue && user.IsApprover.Value)
                GroupName = " Group Members";
            else
                GroupName = " Group Visitors";

            SPSecurity.RunWithElevatedPrivileges(delegate()
            {
                using (SPSite site = new SPSite(SPContext.Current.Web.Url))
                {
                    using (SPWeb web = site.OpenWeb())
                    {
                        try
                        {
                            web.AllowUnsafeUpdates = true;
                            SPUser spUser = web.EnsureUser(user.UserName);
                            if (spUser != null)
                            {
                                SPGroup spGroup = spGatingGroup(web, GroupName);
                                if (spGroup != null && (IsUserInSPGroup(spUser, GroupName.Trim())))
                                {
                                   //For adding user to the group
                                      spGroup.AddUser(spUser);
                                   //For removing user to the group
                                    spGroup.RemoveUser(spUser);
                                    spGroup.Update();
                                }
                            }
                        }
                        catch (Exception ex)
                        {
                            throw ex;
                        }
                        finally
                        {
                            web.AllowUnsafeUpdates = false;
                        }
                    }
                }
            });
        }
 

Sunday, August 5, 2012

SharePoint Interview Questions and Answers: WebPart

  1. Webparts in SharePoint?
  2. Difference between .webparts and .dwp?
  3. Difference between asp.net webparts and SharePoint webparts?
  4. Webpart life cycle?
  5. Difference web parts visual web parts and traditional web part?
  6. Webpart maintenance page?
  7. Main webpart base classes?
  8. A Web Part or Web Form Control on this Page cannot be displayed or imported. The type is not registered as safe.”
  9. How to ensure user controls (.ascx) in webpart. I mean in which method the user controls defines?
  10. Out of box web parts in SharePoint?
  11. Add Web Part inside a Master Page in SharePoint 2010?
  12. Migrate webparts that are developed in SharePoint 2007 into SharePoint 2010?
  13. Difference between user control and webpart?
  14. Connectable webparts in SharePoint?
  15. I have created one webpart and added that in a page. Because of that webpart I am not able to open my page. So I want to delete that webpart from the page. How can I delete it?
  16. Can visual webparts have more than one user controls?
  17.  Webpart deployment life cycle?
  18.  How to define custom properties  at the normal webpart and visual webpart?
  19. How to handle the visibility level of custom properties based on permission levels?
  20.  How can we do validation at the client side in wp, VWP? 
  21.  Is CQWP can fetech data across site collection means from another site collection level?
Webparts:
Web Parts are reusable components that display content on Web pages in SharePoint 2010.

A fantastic new feature in SharePoint 2010 is that you can insert a Web Part in the text of one of the Rich Text Editor zone available in the new Wiki Page. (To add, remove, or rearrange the text zones, use the "Text Layout" menu in edit mode)