Solved

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

Posted on 2009-04-08
3
556 Views
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=2.0.0.0, 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" 

            runat="server">

        </asp:ScriptManager>

    </h2>

    <div>

        <table style="width: 100%; margin-right: 0px">

            <tr>

                <td style="width: 38px">

                    <asp:Label ID="Label1" runat="server" 

                    style="text-align: center; color: #000000; font-weight: 700;" Text="From:"></asp:Label>

                </td>

                <td style="width: 123px">

                <asp:TextBox ID="txtBeginDate" runat="server"></asp:TextBox>

                    <cc1:CalendarExtender ID="txtBeginDate_CalendarExtender" runat="server" 

                        Enabled="True" TargetControlID="txtBeginDate">

                    </cc1:CalendarExtender>

                </td>

                <td style="width: 22px">

                    <asp:Label ID="Label2" runat="server" 

                    style="color: #000000; font-weight: 700;" Text="To:"></asp:Label>

                </td>

                <td style="width: 134px">

                <asp:TextBox ID="txtEndDate" runat="server"></asp:TextBox>

                </td>

                <td>

                <asp:Button ID="btnGenerate" runat="server" Text="Generate Reports" 

                    Width="112px" />

                </td>

            </tr>

        </table>

    </div>

    <div>

    <table style="width: 100%">

        <tr>

            <td>

        <asp:GridView ID="GridView1" runat="server" AutoGenerateColumns="False" 

            CssClass="gridview" DataKeyNames="Result_ID" 

            DataSourceID="SqlDataSource1">

            <Columns>

                <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">

                    <ItemTemplate>

                        <asp:Label ID="lblMID" runat="server" Text='<%# Bind("Session_MID") %>'></asp:Label>

                    </ItemTemplate>

                    <EditItemTemplate>

                        <asp:TextBox ID="TextBox1" runat="server" Text='<%# Bind("Session_MID") %>'></asp:TextBox>

                    </EditItemTemplate>

                </asp:TemplateField>

                <asp:TemplateField HeaderText="Session_LID" SortExpression="Session_LID">

                    <ItemTemplate>

                        <asp:Label ID="lblLID" runat="server" Text='<%# Bind("Session_LID") %>'></asp:Label>

                    </ItemTemplate>

                    <EditItemTemplate>

                        <asp:TextBox ID="TextBox2" runat="server" Text='<%# Bind("Session_LID") %>'></asp:TextBox>

                    </EditItemTemplate>

                </asp:TemplateField>

                <asp:TemplateField HeaderText="Result_ID" SortExpression="Result_ID">

                    <ItemTemplate>

                        <asp:Label ID="lblResult" runat="server" Text='<%# Bind("Result_ID") %>'></asp:Label>

                    </ItemTemplate>

                    <EditItemTemplate>

                        <asp:Label ID="Label1" runat="server" Text='<%# Eval("Result_ID") %>'></asp:Label>

                    </EditItemTemplate>

                </asp:TemplateField>

            </Columns>

        </asp:GridView>

            </td>

            <td>

                &nbsp;</td>

        </tr>

        </table>

        <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)">

            <SelectParameters>

                <asp:ControlParameter ControlID="txtBeginDate" Name="BeginDate" 

                    PropertyName="Text" />

                <asp:ControlParameter ControlID="txtEndDate" Name="EndDate" 

                    PropertyName="Text" />

            </SelectParameters>

        </asp:SqlDataSource>

    </div>
 

    <br /><br />
 

    </asp:Content>

Open in new window

0
Comment
Question by:DotNetNooby
  • 2
3 Comments
 
LVL 10

Assisted Solution

by:GeoffSutton
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.
Geoff
0
 

Accepted Solution

by:
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=2.0.0.0, 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
0
 

Author Comment

by:DotNetNooby
ID: 24111301
Answer found
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Suggested Solutions

Title # Comments Views Activity
SQl help with selection 14 44
Re-position the objects 7 52
Copy/Clone an object. 9 18
Saveas need to save a copy 16 14
ASP.Net to Oracle Connectivity Recently I had to develop an ASP.NET application connecting to an Oracle database.As I am doing it first time ,I had to solve several problems. This article will help to such developers  to develop an ASP.NET client…
Introduction A frequently asked question goes something like this:  "I am running a long process in the background and I want to alert my client when the process finishes.  How can I send a message to the browser?"  Unfortunately, the short answer …
In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're interested in additional methods for monitoring bandwidt…
This video explains how to create simple products associated to Magento configurable product and offers fast way of their generation with Store Manager for Magento tool.

747 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

Need Help in Real-Time?

Connect with top rated Experts

9 Experts available now in Live!

Get 1:1 Help Now