ajaxcalendar extendar未在.net 4.5中显示日历。 [英] ajaxcalendar extendar not showing calendar in .net 4.5.
本文介绍了ajaxcalendar extendar未在.net 4.5中显示日历。的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在使用Visual Studio 2012.我正在使用日历扩展程序,它与空的webform完美配合,而不适用于webforms应用程序。非常感谢任何帮助
对不起,如果粘贴的代码很长,我想告诉你所做的事情。
Webform1。 aspx:
<%@ Page 语言 = C# AutoEventWireup = true CodeBehind = WebForm1.aspx.cs 继承 = WebApplication2.WebForm1 %>
<%@ 注册 assembly = AjaxControlToolkit 命名空间 = AjaxControlToolkit tagprefix = ajaxToolkit %>
< !DOCTYPE html >
< html xmlns = http:// www.w3.org/1999/xhtml\">
< head runat = server >
< title > < / title > ;
< / head >
< body >
< 表格 id = form1 runat = 服务器 >
< div >
< ajaxToolkit:ToolkitScriptManager ID = ToolkitScriptManager1 runat = server >
< br / >
< asp:TextBox ID = TextBox1 runat = server >
< ajaxToolkit:CalendarExtender ID = TextBox1_CalendarExtender runat = server 已启用 = True TargetControlID = TextBox1 >
< / div >
< / form >
< / body >
< / html >
< br $>
Web.config:
<? xml version = 1.0 ? >
<! -
有关如何配置ASP.NET应用程序的详细信息,请访问
http://go.microsoft.com/fwlink/?LinkId= 169433
- >
< 配置 >
< configSections >
<! - 有关实体框架配置的详细信息,请访问http://go.microsoft.com/fwlink/?LinkID= 237468 - >
< section name = entityFramework type = System.Data.Entity.Internal.ConfigFile.EntityFrameworkSection,EntityFramework,Version = 5.0.0.0,Culture = neutral,PublicKeyToken = b77a5c561934e089 < span class =code-attribute> requirePermission = false / >
< / configSections >
< < span class =code-leadattribute> connectionStrings >
< add name = DefaultConnection providerName = System.Data.SqlClient connectionString = 数据源= (LocalDb)\ v11.0;初始目录= aspnet-WebApplication2-20140411163130;集成安全性= SSPI; AttachDBFilename = | DataDirectory | \aspnet-WebApplication2-20140411163130.mdf / >
< / connectionStrings >
< system.web >
< 编译 debug = true targetFramework = 4.5 >
< 程序集 >
< add 程序集 = System.Design ,Version = 4.0.0.0,Culture = neutral,PublicKeyToken = B03F5F7F11D50A3A / >
< add < span class =code-attribute> assembly = System.Web.Extensions.Design,Version = 4.0.0.0,Culture = neutral,PublicKeyToken = 31BF3856AD364E35 / >
< add assembly = System.Windows.Forms,Version = 4.0.0.0,Culture = neutral,PublicKeyToken = B77A5C561934E089 / >
< / assemblies >
< / compilation >
< 的httpRuntime 跨度> targetFramework = 4.5 / >
< 页 >
< 名称空间 >
< add namespace = System.Web.Optimization / >
< / namespaces >
< span class =code-keyword>< controls >
< add 程序集 = Microsoft.AspNet.Web.Optimization.WebForms 命名空间 = Microsoft.AspNet.Web.Optimization.WebForms tagPrefix = webopt / >
< add namespace = AjaxControlToolkit assembly = AjaxControlToolkit tagPrefix = ajaxToolkit / >
< / controls >
< / pages >
< 身份验证 模式 = 表单 >
< 表格 loginUrl = 〜/ Account / Login.aspx 超时 = 2880 / >
< / authentication >
< profile defaultProvider = DefaultProfileProvider >
< 提供商 >
< add 名称 = DefaultProfileProvider type = System.Web.Providers.DefaultProfileProvider,System.Web.Providers,Version = 1.0.0.0,Culture = neutral,PublicKeyToken = 31bf3856ad364e35 connectionStringName = DefaultConnection applicationName = / / > ;
< / providers >
< / profile >
< 成员资格 defaultProvider = DefaultMembershipProvider >
< 提供商 >
< 添加 name = DefaultMembershipProvider type = System.Web.Providers .DefaultMembershipProvider,System.Web.Providers,Version = 1.0.0.0,Culture = neutral,PublicKeyToken = 31bf3856ad364e35 connectionStringName = DefaultConnection enablePasswordRetrieval = false < span class =code-attribute> enablePasswordReset = true requiresQuesti onAndAnswer = false requiresUniqueEmail = false maxInvalidPasswordAttempts = 5 minRequiredPasswordLength = 6 minRequiredNonalphanumericCharacters < span class =code-keyword> = 0 passwordAttemptWindow = 10 applicationName = / / >
< / providers >
< / membership >
< roleManager defaultProvider = DefaultRoleProvider >
< 提供商 >
< add name = DefaultRoleProvider type = System.Web.Providers.DefaultRoleProvider,System.Web.Providers,Version = 1.0.0.0,Culture = neutral,PublicKeyToken = 31bf3856ad364e35 connectionStringName = DefaultConnection applicationName = / / >
< / providers > 温泉n>
< / roleManager >
< sessionState mode = InProc customProvider = DefaultSessionProvider >
< 提供商 >
< add name = DefaultSessionPr ovider type = System.Web.Providers.DefaultSessionStateProvider,System.Web.Providers,Version = 1.0.0.0,Culture = neutral,PublicKeyToken = 31bf3856ad364e35 connectionStringName = DefaultConnection / >
< ; / providers >
< / sessionState >
< / system.web >
< entityFramework >
< defaultConnectionFactory type = System.Data.Entity.Infrastructure.SqlConnectionFactory,EntityFramework / >
< / entityFramework >
< / configuration >
[edit]缺少代码块添加[/ edit]
解决方案
试试这个
< ajaxtoolkit:ToolkitScriptManager runat = server EnableScriptGlobalization = true EnableScriptLocalization = true CombineScripts = false ID = ScriptManager11 >
< / ajaxtoolkit:ToolkitScriptManager > 跨度>
I am using Visual Studio 2012. I am working with calendar extender and that works perfectly with empty webform and not working withe webforms application. Any help greatly appreciated
Sorry if the pasted code is very long, I want to let you know about what was done.
Webform1.aspx:
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="WebForm1.aspx.cs" Inherits="WebApplication2.WebForm1" %>
<%@ Register assembly="AjaxControlToolkit" namespace="AjaxControlToolkit" tagprefix="ajaxToolkit" %>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
<title></title>
</head>
<body>
<form id="form1" runat="server">
<div>
<ajaxToolkit:ToolkitScriptManager ID="ToolkitScriptManager1" runat="server">
<br />
<asp:TextBox ID="TextBox1" runat="server">
<ajaxToolkit:CalendarExtender ID="TextBox1_CalendarExtender" runat="server" Enabled="True" TargetControlID="TextBox1">
</div>
</form>
</body>
</html>
Web.config:
<?xml version="1.0"?>
<!--
For more information on how to configure your ASP.NET application, please visit
http://go.microsoft.com/fwlink/?LinkId=169433
-->
<configuration>
<configSections>
<!-- For more information on Entity Framework configuration, visit http://go.microsoft.com/fwlink/?LinkID=237468 -->
<section name="entityFramework" type="System.Data.Entity.Internal.ConfigFile.EntityFrameworkSection, EntityFramework, Version=5.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false"/>
</configSections>
<connectionStrings>
<add name="DefaultConnection" providerName="System.Data.SqlClient" connectionString="Data Source=(LocalDb)\v11.0;Initial Catalog=aspnet-WebApplication2-20140411163130;Integrated Security=SSPI;AttachDBFilename=|DataDirectory|\aspnet-WebApplication2-20140411163130.mdf"/>
</connectionStrings>
<system.web>
<compilation debug="true" targetFramework="4.5">
<assemblies>
<add assembly="System.Design, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B03F5F7F11D50A3A"/>
<add assembly="System.Web.Extensions.Design, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35"/>
<add assembly="System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>
</assemblies>
</compilation>
<httpRuntime targetFramework="4.5"/>
<pages>
<namespaces>
<add namespace="System.Web.Optimization"/>
</namespaces>
<controls>
<add assembly="Microsoft.AspNet.Web.Optimization.WebForms" namespace="Microsoft.AspNet.Web.Optimization.WebForms" tagPrefix="webopt"/>
<add namespace="AjaxControlToolkit" assembly="AjaxControlToolkit" tagPrefix="ajaxToolkit"/>
</controls>
</pages>
<authentication mode="Forms">
<forms loginUrl="~/Account/Login.aspx" timeout="2880"/>
</authentication>
<profile defaultProvider="DefaultProfileProvider">
<providers>
<add name="DefaultProfileProvider" type="System.Web.Providers.DefaultProfileProvider, System.Web.Providers, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" connectionStringName="DefaultConnection" applicationName="/"/>
</providers>
</profile>
<membership defaultProvider="DefaultMembershipProvider">
<providers>
<add name="DefaultMembershipProvider" type="System.Web.Providers.DefaultMembershipProvider, System.Web.Providers, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" connectionStringName="DefaultConnection" enablePasswordRetrieval="false" enablePasswordReset="true" requiresQuestionAndAnswer="false" requiresUniqueEmail="false" maxInvalidPasswordAttempts="5" minRequiredPasswordLength="6" minRequiredNonalphanumericCharacters="0" passwordAttemptWindow="10" applicationName="/"/>
</providers>
</membership>
<roleManager defaultProvider="DefaultRoleProvider">
<providers>
<add name="DefaultRoleProvider" type="System.Web.Providers.DefaultRoleProvider, System.Web.Providers, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" connectionStringName="DefaultConnection" applicationName="/"/>
</providers>
</roleManager>
<sessionState mode="InProc" customProvider="DefaultSessionProvider">
<providers>
<add name="DefaultSessionProvider" type="System.Web.Providers.DefaultSessionStateProvider, System.Web.Providers, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" connectionStringName="DefaultConnection"/>
</providers>
</sessionState>
</system.web>
<entityFramework>
<defaultConnectionFactory type="System.Data.Entity.Infrastructure.SqlConnectionFactory, EntityFramework"/>
</entityFramework>
</configuration>
[edit]Missing Code block added[/edit]
解决方案
Try this
<ajaxtoolkit:ToolkitScriptManager runat="server" EnableScriptGlobalization="true" EnableScriptLocalization="true" CombineScripts="false" ID="ScriptManager11"> </ajaxtoolkit:ToolkitScriptManager>
这篇关于ajaxcalendar extendar未在.net 4.5中显示日历。的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文