home *** CD-ROM | disk | FTP | other *** search
/ io Programmo 40 / IOPROG_40.ISO / SOFT / NETFrameworkSDK.exe / comsdk.cab / samples.exe / QuickStart / aspplus / doc / servicesandobjs.aspx < prev    next >
Encoding:
Text File  |  2000-06-11  |  2.2 KB  |  50 lines

  1. <%@ Register TagPrefix="Acme" TagName="SourceRef" Src="/quickstart/util/SrcRef.aspx"%>
  2.  
  3. <!-- #include virtual="/quickstart/aspplus/include/header.inc" -->
  4.  
  5. <h4>Using Objects and Intrinsics</h4>
  6. This sample illustrates how to access ASP+ intrinsics, such as the Session and Application objects. It also shows how to turn off Session on a per-[WebMethod] basis.
  7. <p>
  8. The first method in the sample .asmx file, <B>UpdateHitCounter</B> accesses the Session, and adds 1 to the "HitCounter" value. It then returns this value as a String. The second method, <B>UpdateAppCounter</B> does the same thing, but with the Application. Notice the following:
  9.  
  10. <p>
  11. <div class="code"><pre>
  12. [WebMethod(EnableSession=False)]
  13. </pre></div>
  14. <p>
  15.  
  16. This turns off Session support, which will speed up this Web Method's performance. Sessions aren't needed for this object, since it only uses the Application object. This compiler directive is recommended in cases where performance is critical.
  17. <p>
  18.  
  19. <table>
  20. <tr>
  21. <td>
  22. <Acme:SourceRef 
  23.   RunSample="/quickstart/aspplus/samples/services/Intrinsics/SessionService1.asmx" 
  24.   ViewSource="/quickstart/aspplus/samples/services/Intrinsics/SessionService1.src"
  25.   Icon="/quickstart/aspplus/images/sessionservice_asmx.gif"
  26.   Caption="SessionService.asmx"
  27.   runat="server" />
  28. </td>
  29. <td>
  30. <Acme:SourceRef 
  31.   RunSample="/quickstart/aspplus/samples/services/Intrinsics/SessionService1.asmx?SDL" 
  32.   Icon="/quickstart/aspplus/images/service_sdl.gif"
  33.   Caption="SessionService.sdl"
  34.   runat="server" />
  35. </td>
  36. </tr>
  37. </table>
  38.  
  39. <p>
  40. When the client proxy is accessed, it contains a cookie collection. This collection is used to accept and return the APSESSIONID cookie that ASP+ uses to track Sessions. This is what allows this client to receive varying answers to the Session hit method.
  41. <p>
  42.  
  43. <Acme:SourceRef 
  44.   RunSample="/quickstart/aspplus/samples/services/Intrinsics/SessionService1Client.aspx" 
  45.   ViewSource="/quickstart/aspplus/samples/services/Intrinsics/SessionService1Client.src"
  46.   Icon="/quickstart/aspplus/images/sessionservice_client.gif"
  47.   Caption="SessionServiceClient.aspx"
  48.   runat="server" />
  49.  
  50. <!-- #include virtual="/quickstart/aspplus/include/footer.inc" -->