Posts

Showing posts from October, 2014

LINQ with joins using sharepoint lists

Image
Here this code is used for using joins in linq uisng sharepoint lists. here is the code.         SPList Firstlist = objWeb . Lists [ "FirstList" ]; SPList Secondlist = objWeb . Lists [ "Secondlist" ]; SPList Thirdlist = objWeb . Lists [ "ThirdList" ]; var customerorders = from SPListItem first in Firstlist . Items join SPListItem second in Secondlist . Items on first [ "Location" ] equals second [ "Location" ] join SPListItem third in Thirdlist . Items on first [ "Location" ] equals third [ "Location" ] select new { Location = Convert . ToString ( first [ "Location" ]), Name = Convert . ToString ( first [ "Name" ]), Address = Convert . ToString ( second [ "Address" ]), Status = Convert . ToString ( third [ "Status" ]) };    

Enable and disable div using radiobutton list

here radiolist is a radiobutton list with two values. <asp:RadioButtonList ID="radiolist" runat="server" onclick="GetRadioButtonListSelectedValue(this);">                                                                                                                         <asp:ListItem Value="witharn" Selected="True"><b>With EUIN & distributor code</b></asp:ListItem>                                                             <asp:ListItem Value="Withoutarn"><b>Without distributor code</b></asp:ListItem>                                                                                                                   </asp:RadioButtonList> disable or enable panel using javascript     var chk = $("#<%=radiolist.ClientID%>").find(":checked").val();     function GetRadioButtonListSelectedValue(radioButtonList) {         for (var i = 0

RadiobuttonList set and get values javascript

For getting values from radiobuttton list <asp:RadioButtonList ID="radiolist" runat="server" onclick="GetRadioButtonListSelectedValue(this);">                                                                                                                         <asp:ListItem Value="witharn" Selected="True"><b>With EUIN & distributor code</b></asp:ListItem>                                                             <asp:ListItem Value="Withoutarn"><b>Without distributor code</b></asp:ListItem>                                                                                                                   </asp:RadioButtonList> and script is function GetRadioButtonListSelectedValue(radioButtonList) {         for (var i = 0; i < radioButtonList.rows.length; ++i) {             if (radioButtonList.rows[i].cells[0].firstChild.checked) {                 var ch

Browser Back Button Click Event Handling in JavaScript

Normally, the onbeforeunload event is used for handling browser back button functionality as follows: <body onbeforeunload="HandleBackFunctionality()">  function HandleBackFunctionality()  {        if(window.event) //Internet Explorer       {            alert("Browser back button is clicked on Internet Explorer...");        }        else //Other browsers for example Chrome        {            alert("Browser back button is clicked on other browser...");        }  } But there is a problem that identical events can occur once a user clicks on the refresh button of a browser. So, to grasp whether the refresh button or back button is clicked, we will use the subsequent code. if(window.event.clientX < 40 && window.event.clientY < 0)  {       alert("Browser back button is clicked...");  }  else  {       alert("Browser refresh button is clicked...");  } The snippet of code above works well in browsers other than FireFox.

Sitemappath in sharepoint

We can add sitemap to sharepoint site by using this code. <div style="padding-top: 20px; padding-left: 20px; padding-bottom: 10px;">                                         <a href="../../default.aspx">home</a> <asp:SiteMapPath SiteMapProvider="SPContentMapProvider"       ID="ContentMap" SkipLinkText=""                                             NodeStyle-CssClass="ms-sitemapdirectional" runat="server"/> </div>