This code for acess User Information List Title Name using Client side.
<asp:Content ContentPlaceHolderId="PlaceHolderMain" runat="server">
<ul id="UserName"/>
</asp:Content>
01 <script type=
"text/javascript"
src=
"http://jqueryjs.googlecode.com/files/jquery-1.3.2.min.js"
></script>
02 |
03 | <script type= "text/javascript" > |
04 | $(document).ready( function () { |
05 | var soapEnv = |
06 | "<soapenv:Envelope xmlns:soapenv= 'http://schemas.xmlsoap.org/soap/envelope/' > \ |
07 | <soapenv:Body> \ |
08 | <GetListItems xmlns= 'http://schemas.microsoft.com/sharepoint/soap/' > \ |
09 | <listName>User Information List</listName> \ |
10 | <query></query>\ |
11 | <viewFields> \ |
12 | <ViewFields> \ |
13 | <FieldRef Name= 'Title' /> \ |
14 | </ViewFields> \ |
15 | </viewFields> \ |
16 | </GetListItems> \ |
17 | </soapenv:Body> \ |
18 | </soapenv:Envelope>"; |
19 |
20 | $.ajax({ |
21 | url: "http://svrName:2020/_vti_bin/lists.asmx" , |
22 | type: "POST" , |
23 | dataType: "xml" , |
24 | data: soapEnv, |
25 | complete: processResult, |
26 | contentType: "text/xml; charset=\"utf-8\"" |
27 | }); |
28 | }); |
29 |
30 | function processResult(xData, status) { |
31 | $(xData.responseXML).find( "z\\:row" ).each( function () { |
32 | var liHtml = "<li>" + $( this ).attr( "ows_Title" ) + "</li>" ; |
33 | $( "#UserName" ).append(liHtml); |
34 | }); |
35 | } |
36 | </script> |
<ul id="UserName"/>
</asp:Content>
Comments