Getting an error after adding an ajax calendar extender to a text box

Posted on 2009-04-08
Last Modified: 2013-11-08
When I add a calendar extender to a text box and try and build the solution I get some Validation XHTML warnings, an unrecognized tag prefix for cc1, an unable to update auto-refresh reference 'ajaxcontroltoolkit.dll' and an error sayig "request for the permission of type 'System.Web.AspNetHostingPermissino, System, Version=, Culture=netural, public key token failed.
<%@ Page Language="VB" MasterPageFile="~/Site.master" CodeFile="Default.aspx.vb" Inherits="_Default" %>
<%@ Register assembly="AjaxControlToolkit" namespace="AjaxControlToolkit" tagprefix="cc1" %>
<asp:Content ID="Content1" ContentPlaceHolderID="ContentPlaceHolder1" Runat="Server">
    <h2>Select a date range to display reports<asp:ScriptManager ID="ScriptManager2" 
        <table style="width: 100%; margin-right: 0px">
                <td style="width: 38px">
                    <asp:Label ID="Label1" runat="server" 
                    style="text-align: center; color: #000000; font-weight: 700;" Text="From:"></asp:Label>
                <td style="width: 123px">
                <asp:TextBox ID="txtBeginDate" runat="server"></asp:TextBox>
                    <cc1:CalendarExtender ID="txtBeginDate_CalendarExtender" runat="server" 
                        Enabled="True" TargetControlID="txtBeginDate">
                <td style="width: 22px">
                    <asp:Label ID="Label2" runat="server" 
                    style="color: #000000; font-weight: 700;" Text="To:"></asp:Label>
                <td style="width: 134px">
                <asp:TextBox ID="txtEndDate" runat="server"></asp:TextBox>
                <asp:Button ID="btnGenerate" runat="server" Text="Generate Reports" 
                    Width="112px" />
    <table style="width: 100%">
        <asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" 
            CssClass="gridview" DataKeyNames="Result_ID" 
                <asp:CommandField ShowSelectButton="True" />
                <asp:BoundField DataField="First_Name" HeaderText="First_Name" 
                    SortExpression="First_Name" />
                <asp:BoundField DataField="Last_Name" HeaderText="Last_Name" 
                    SortExpression="Last_Name" />
                <asp:BoundField DataField="When_Started" HeaderText="When_Started" 
                    SortExpression="When_Started" />
                <asp:BoundField DataField="Participant" HeaderText="Participant" 
                    SortExpression="Participant" />
                <asp:BoundField DataField="Monitor_Name" HeaderText="Monitor_Name" 
                    SortExpression="Monitor_Name" />
                <asp:TemplateField HeaderText="Session_MID" SortExpression="Session_MID">
                        <asp:Label ID="lblMID" runat="server" Text='<%# Bind("Session_MID") %>'></asp:Label>
                        <asp:TextBox ID="TextBox1" runat="server" Text='<%# Bind("Session_MID") %>'></asp:TextBox>
                <asp:TemplateField HeaderText="Session_LID" SortExpression="Session_LID">
                        <asp:Label ID="lblLID" runat="server" Text='<%# Bind("Session_LID") %>'></asp:Label>
                        <asp:TextBox ID="TextBox2" runat="server" Text='<%# Bind("Session_LID") %>'></asp:TextBox>
                <asp:TemplateField HeaderText="Result_ID" SortExpression="Result_ID">
                        <asp:Label ID="lblResult" runat="server" Text='<%# Bind("Result_ID") %>'></asp:Label>
                        <asp:Label ID="Label1" runat="server" Text='<%# Eval("Result_ID") %>'></asp:Label>
        <asp:SqlDataSource ID="SqlDataSource1" runat="server" 
            ConnectionString="<%$ ConnectionStrings:QuestionmarkConnectionString %>" 
            SelectCommand="SELECT DISTINCT First_Name, Last_Name, When_Started, Participant, Monitor_Name, Session_MID, Session_LID, Result_ID FROM AResultASession WHERE (When_Finished BETWEEN @BeginDate AND @EndDate)">
                <asp:ControlParameter ControlID="txtBeginDate" Name="BeginDate" 
                    PropertyName="Text" />
                <asp:ControlParameter ControlID="txtEndDate" Name="EndDate" 
                    PropertyName="Text" />
    <br /><br />

Open in new window

Question by:DotNetNooby
  • 2
LVL 10

Assisted Solution

GeoffSutton earned 200 total points
ID: 24106270
I am betting you also get this same error with ANY Ajax Control Toolkit items, not just the extender.  Does your project have a reference to the Ajax Control Toolkit DLL file?  Also since you are using VS2008, you may need to reinstall VS.  I have had some problems popup on me with this build where I have had to reinstall before it would work.  But make sure the references are in place before anything.
Let me konw how it works out - This is definitely a configuration error, not a coding error.

Accepted Solution

DotNetNooby earned 0 total points
ID: 24111269
Started getting this error after VS 2008 SP1 install, while trying to build a simple test ASP.NET site
               Request for the permission of type 'System.Web.AspNetHostingPermission, System, Version=, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed.               U:\WebSites\AjaxTest\Default.aspx            
"      This error indicates some problem with the CASPOL permissions.
"      The Content is on a mapped drive pointing to a remote share, hence gave permissions using the caspol.exe command in cmd
C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\caspol.exe -m -ag 1 -url "file:////\\computername\sharename\*" FullTrust -exclusive on

Author Comment

ID: 24111301
Answer found

Featured Post

Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Introduction Got endorsements from your clients?  Great!  There is almost nothing better than word-of-mouth advertising.  But how can you do that on the internet?  Sure you can make a page for endorsement quotations and list them all, but who is …
The Confluence of Individual Knowledge and the Collective Intelligence At this writing (summer 2013) the term API ( has made its way into the popular lexicon of the English language.  A few years ago, …
Email security requires an ever evolving service that stays up to date with counter-evolving threats. The Email Laundry perform Research and Development to ensure their email security service evolves faster than cyber criminals. We apply our Threat…
Although Jacob Bernoulli (1654-1705) has been credited as the creator of "Binomial Distribution Table", Gottfried Leibniz (1646-1716) did his dissertation on the subject in 1666; Leibniz you may recall is the co-inventor of "Calculus" and beat Isaac…

839 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question