comparison Demo/Partial.Trust/Asp.Net/Default.aspx @ 0:f990fcb411a9

Копия текущей версии из github
author cin
date Thu, 27 Mar 2014 21:46:09 +0400
parents
children
comparison
equal deleted inserted replaced
-1:000000000000 0:f990fcb411a9
1 <%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="Partial.Trust.Asp.Net._Default" %>
2
3 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
4
5 <html xmlns="http://www.w3.org/1999/xhtml" >
6 <head runat="server">
7 <title>Partial Trust Demo</title>
8 </head>
9 <body style="font-family: Verdana; font-size: small">
10 <form id="form1" runat="server">
11
12 <div style="padding: 10px">
13 To use BLToolkit in Partial Trust Environment you should perform the following steps:
14
15 <div style="padding-left: 20px; padding-top: 10px;">
16 For all assemblies containing classes for which BLToolkit generates new types such as Partial.Trust.Components.dll in this demo:
17
18 <div style="padding-left: 20px; padding-top: 10px;">
19 <ul>
20 <li>
21 Sign the assembly.
22 </li>
23 <li style="padding-top: 10px">
24 Add the AllowPartiallyTrustedCallers attribute:
25 <pre style="font-size: small">[assembly: AllowPartiallyTrustedCallers]</pre>
26 </li>
27
28 <li>
29 Use BLTgen.exe to generate BLToolkit extensions at the post-build step. For example:<br/><br/>
30
31 $(ProjectDir)..\..\..\Tools\BLTgen\bin\$(ConfigurationName)\BLTgen.4.exe $(TargetPath) /O:$(ProjectDir)..\Asp.Net\bin /K:$(ProjectDir)Partial.Trust.snk /D<br/><br/>
32
33 Extension assembly must be signed as well (use /K flag).
34 </li>
35 </ul>
36 </div>
37
38 Turn the TypeFactory.LoadTypes flag on.
39
40 <div style="padding-left: 20px; padding-top: 10px;">
41 Add the following section in the Web.config file:
42
43 <pre style="font-size: small; padding-left: 20px;">
44 &lt;configSections&gt;
45 &lt;section name="bltoolkit" type="BLToolkit.Configuration.BLToolkitSection, BLToolkit.4" requirePermission="false"/&gt;
46 &lt;/configSections&gt;
47 &lt;bltoolkit&gt;
48 &lt;typeFactory loadTypes="true" /&gt;
49 &lt;/bltoolkit&gt;
50 </pre>
51
52 - or<br/><br/>
53
54 set
55
56 <pre style="font-size: small; padding-left: 20px;">TypeFactory.LoadTypes = true;</pre>
57
58 somewhere before the first use of BLToolkit (Global.asax for Web applications).
59
60 </div>
61 </div>
62
63 <br/>
64 <br/>
65
66 Sample output:
67 <br/>
68 <br/>
69
70 <div style="padding-left: 20px;">
71 <table>
72 <tr><td>DataAccessor:</td> <td><asp:Label ID="Label1" runat="server" ></asp:Label></td></tr>
73 <tr><td>Linq query:</td> <td><asp:Label ID="Label2" runat="server" ></asp:Label></td></tr>
74 <tr><td>Compiled Linq query:</td><td><asp:Label ID="Label3" runat="server" ></asp:Label></td></tr>
75 </table>
76 </div>
77
78 </div>
79 </form>
80 </body>
81 </html>