Asp.net 使用DataPager时出现SecurityException

Asp.net 使用DataPager时出现SecurityException,asp.net,vb.net,Asp.net,Vb.net,当我运行这个页面时,在我的应用程序中添加了DataPager控件,我在下面遇到了以下错误 安全例外 说明: 应用程序试图执行安全策略不允许的操作。要授予此应用程序所需的权限,请与系统管理员联系,或在配置文件中更改应用程序的信任级别 异常详细信息:System.Security.SecurityException:请求“System.Web.AspNetHostingPermission,System,Version=2.0.0.0,Culture=neutral,PublicKeyToken=b

当我运行这个页面时,在我的应用程序中添加了DataPager控件,我在下面遇到了以下错误

安全例外

说明:

应用程序试图执行安全策略不允许的操作。要授予此应用程序所需的权限,请与系统管理员联系,或在配置文件中更改应用程序的信任级别

异常详细信息:System.Security.SecurityException:请求“System.Web.AspNetHostingPermission,System,Version=2.0.0.0,Culture=neutral,PublicKeyToken=b77a5c561934e089”类型的权限失败

源错误:

在执行当前web请求期间生成了未经处理的异常。有关异常的起源和位置的信息可以使用下面的异常堆栈跟踪来识别

堆栈跟踪:

[安全例外:请求“System.Web.AspNetHostingPermission,System,Version=2.0.0.0,Culture=neutral,PublicKeyToken=b77a5c561934e089”类型的权限失败。] System.Reflection.Assembly.\u GetType(字符串名称、布尔throwOnError、布尔ignoreCase)+0 System.Web.UI.NamespaceTagNameToTypeMapper.GetControlType(字符串标记名、IDictionary属性、布尔throwOnError)+98 System.Web.UI.NamespaceTagNameToTypeMapper.System.Web.UI.ITagNameToTypeMapper.GetControlType(字符串标记名,IDictionary属性)+11 System.Web.UI.TagPrefixTagNameToTypeMapper.System.Web.UI.ITagNameToTypeMapper.GetControlType(字符串标记名,IDictionary属性)+127 System.Web.UI.MainTagNameToTypeMapper.GetControlType2(字符串标记名、IDictionary属性、布尔fAllowHtmlTags)+228 System.Web.UI.MainTagNameToTypeMapper.GetControlType(字符串标记名、IDictionary属性、布尔fAllowHtmlTags)+28 System.Web.UI.RootBuilder.GetChildControlType(字符串标记名,IDictionary属性)+20 System.Web.UI.ControlBuilder.CreateChildBuilder(字符串过滤器、字符串标记名、IDictionary属性、TemplateParser解析器、ControlBuilder parentBuilder、字符串id、Int32行、VirtualPath VirtualPath、Type&childType、布尔defaultProperty)+69 System.Web.UI.TemplateParser.ProcessBeginTag(匹配,字符串输入文本)+526 System.Web.UI.TemplateParser.ParseStringInternal(字符串文本,编码文件编码)+926

下面是代码

       <%@ Page Language="VB" MasterPageFile="~/CIOSMasterNonAuth.master"           AutoEventWireup="false" CodeFile="ViewOrdersChanged.aspx.vb" Inherits="ViewOrders" title="Untitled Page" %>

        <%@ Register Assembly="AjaxControlToolkit" Namespace="AjaxControlToolkit" TagPrefix="cc1" %>

        <asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
        <%--<asp:ScriptManager ID="ScriptManager1" runat="server"> </asp:ScriptManager>--%>
                     <asp:Table runat="server" Font-Size="Small" HorizontalAlign="Center">
                     <asp:TableRow>
                     <asp:TableCell HorizontalAlign="Right">
                     <asp:Label runat="server">Order Status: </asp:Label>
                   </asp:TableCell>
           <asp:TableCell HorizontalAlign="Left">
           <asp:DropDownList ID="OrderStatusDropDownList" runat="server" AutoPostBack="True">
         <asp:ListItem Text="Verified" Value="V" />
         <asp:ListItem Text="New" Value="N" />
         <asp:ListItem Text="Cancelled" Value="C" />
                   </asp:DropDownList>
                         </asp:TableCell>
                      </asp:TableRow>
                                                       <asp:TableRow>
                       <asp:TableCell ColumnSpan="2">
                          <asp:Repeater ID="Repeater1" runat="server" DataSourceID="SqlDataSource1">
    <HeaderTemplate>
                                       <table border="1" visible="false">
                    <tr>
                        <th>
                            Web Order ID
                        </th>
                        <th>
                            Web Entry Date
                        </th>
                        <th>
                            Protocol Number
                        </th>
                        <th>
                            Site Number
                        </th>
                        <th>
                            Pharmacist of Record
                        </th>
                    </tr>
            </HeaderTemplate>
            <ItemTemplate>
                <tr>
                    <td>
                        <asp:LinkButton runat="server" ID="lnkOrderDetails" Text='<%# Eval("web_order_id") %>' OnClick="lnkOrderDetails_Click" />
                    </td>
                    <td>
                        <asp:Label ID="lblWebEntryDate" runat="server" Text='<%# Eval("web_entry_date") %>'>
                        </asp:Label>
                    </td>
                    <td>
                        <asp:Label ID="lblProtocolNum" runat="server" Text='<%# Eval("protocol_num") %>'>
                        </asp:Label>
                    </td>
                    <td>
                        <asp:Label ID="lblSiteNum" runat="server" Text='<%# Eval("site_num") %>'>
                        </asp:Label>
                    </td>
                    <td>
                        <asp:Label ID="lblPharmName" runat="server" Text='<%# Eval("PharmName") %>'>
                        </asp:Label>                        
                    </td>

                </tr>
            </ItemTemplate>
                                  <FooterTemplate>
                </table>
            </FooterTemplate>
    </asp:Repeater>
    </asp:TableCell>
    </asp:TableRow>
</asp:Table>

           <asp:Button runat="server" ID="btnShowModalPopup" style="display:none"/>
           <cc1:ModalPopupExtender ID="ModalPopupExtender1" runat="server"
    TargetControlID="btnShowModalPopup"
     PopupControlID="divPopUp" 
    PopupDragHandleControlID="panelDragHandle">
    </cc1:ModalPopupExtender>

           <div id="divPopUp" style="display:none; font-family:Georgia; font-size:small;">
            <asp:Panel runat="Server" ID="panelDragHandle" BackColor="#009999" BorderColor="ActiveBorder" BorderStyle="Ridge" ForeColor="White" Width="800px">
            <table width="100%">
          <tr>
            <td>
         Hold here to Drag this Box
        </td>
        <td align="right">
          <asp:Label runat="server" ID="lblText" Text="Web OrderID: " ForeColor="White"></asp:Label>

            <asp:Label ID="lblWebOrderID" runat="server"></asp:Label>
     </td>
     </tr>
     <tr>
     <td colspan="2"> 
               <asp:GridView ID="GridView2" runat="server" BackColor="#FFFFCC" ForeColor="Black" AutoGenerateColumns="False" Width="100%" >

     <Columns>
     <asp:BoundField DataField="line_id" HeaderText="Line Item"/>
     <asp:BoundField DataField="no_of_participants" HeaderText="Number of Participants" />
     <asp:BoundField DataField="amt_inventory" HeaderText="Current Inventory"/>
     <asp:BoundField DataField="nsc_num" HeaderText="NSC number"/>
     <asp:BoundField DataField="drug_name" HeaderText="Drug name"/>
     <asp:BoundField DataField="dose_str" HeaderText="Dose Strength"/>
     <asp:BoundField DataField="dose_unit" HeaderText="Dose Unit"/>
     <asp:BoundField DataField="dose_form_comment" HeaderText="Dose Form"/>
     <asp:BoundField DataField="dose_mult" HeaderText="Dose Mult" />
     <asp:BoundField DataField="amt_req" HeaderText="Amt Required"/>
     </Columns>
     </asp:GridView> 
     </td> 
     </tr>
     <tr> 
                       <td colspan="2" align="right">                       
    <asp:Button ID="btnClose" runat="server" Text="Close" />
    </td>
    </tr>
    </table>
    </asp:Panel>
   <br />

</div>


              <asp:SqlDataSource ID="SqlDataSource1" runat="server"   ConnectionString="
               <%$ ConnectionStrings:CIOSConnectionString3 %>" SelectCommand="SELECT w.web_order_id, w.web_entry_date, w.site_num, w.protocol_num, w.inv_num, w.pharm_num, w.status, w.Comments, w.UserName, w.porStatus, ISNULL(p.Pharm_fname, ' ') + ' ' + ISNULL(p.Pharm_lname, ' ') AS 'PharmName' FROM Web_Shipping AS w INNER JOIN Pharmacist_of_record AS p ON p.pharm_num = w.pharm_num WHERE (w.status = @status) ORDER BY w.web_order_id DESC" >
         <SelectParameters>
            <asp:ControlParameter ControlID="OrderStatusDropDownList" Name="Status" 
                PropertyName="Text" Type="Char" />
                </SelectParameters>
        </asp:SqlDataSource>

         <asp:SqlDataSource ID="SqlDataSource2" runat="server" ConnectionString="<%$ ConnectionStrings:CIOSConnectionString3 %>" 

        SelectCommand="SELECT Web_Ship_detail.line_id, Web_Ship_detail.no_of_participants, Web_Ship_detail.Amt_inventory, Web_Ship_detail.NSC_num, Web_Ship_detail.Dose_str, Web_Ship_detail.Dose_unit, Web_Ship_detail.Dose_mult, Web_Ship_detail.amt_req, Drug.Drug_name, Dosage_Form.dose_form_comment FROM Web_Ship_detail INNER JOIN Drug ON Web_Ship_detail.NSC_num = Drug.NSC_Num INNER JOIN Dosage_Form ON Web_Ship_detail.Dose_form = Dosage_Form.dose_form WHERE (Web_Ship_detail.web_order_id = @web_order_id) ORDER BY Web_Ship_detail.line_id">
        <SelectParameters>
            <asp:ControlParameter ControlID="lblWebOrderID" Name="web_order_id" 
                PropertyName="Text" Type="Decimal" />
        </SelectParameters>
   </asp:SqlDataSource>

    <asp:DataPager ID="DataPager1" 
                   PagedControlID="OrderStatusDropDownList" 
                   PageSize="5"  runat="server">
      <Fields>
            <asp:NextPreviousPagerField ButtonType="Button" 
            ShowFirstPageButton="true" 
            ShowLastPageButton="true"
            ShowNextPageButton="true"  
            ShowPreviousPageButton="true"  />
       </Fields>

    </asp:DataPager>

</asp:Content>

订单状态:
Web订单ID
网页输入日期
协议号
站点号
执业药剂师
按住此处拖动此框


您试图做些什么来解决这个问题?对这个异常的简单搜索会得到很多建议。例如,我添加了一个控件数据寻呼机,它给出了一个错误。我已经编辑了你的标题。请参阅“”,其中的共识是“不,他们不应该”。