使用日历扩展程序和用户控件时出错 [英] Error while using calendar extender and user control

查看:126
本文介绍了使用日历扩展程序和用户控件时出错的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

亲爱的朋友们,



我创建了一个用户控件并在几页内使用。

在所有页面中它工作正常但是我在哪里使用日历扩展器,它显示以下错误。

请建议。



Dear Friends,

I have create a user control and used in few pages.
In all the pages it works fine but where ever I am using calendar extender, it show following error.
Kindly suggest.

Server Error in '/new' Application.

The Controls collection cannot be modified because the control contains code blocks (i.e. <% ... %>).

Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.Web.HttpException: The Controls collection cannot be modified because the control contains code blocks (i.e. <% ... %>).

Source Error:

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.

推荐答案

看看下面的链接:

由于控件包含代码块而无法修改控件集合 [< a href =http://www.codeproject.com/Answers/516673/TheplusControlsplusCollectionplusCannotplusBeplusM#answer1target =_ blanktitle =New Window> ^ ]



您还可以找到更多答案此处 [ ^ ]
Have a look at below link:
The Controls Collection Cannot Be Modified Because the Control Contains Code Blocks[^]

Also you will find more answers here[^]


您好b $ b



使用<启动代码块;%#而不是<%=





Hi

start the code block with <%# instead of <%=


<head id="head1" runat="server">
  <title>My Page</title>
  <link href="css/common.css" rel="stylesheet" type="text/css" />
  <script type="text/javascript" src="<%# ResolveUrl("~/javascript/leesUtils.js") %>"></script>
</head>





检查此解决方案: -





http://leedumond.com/blog/the-controls -collection-can-be-modified-because-the-control-contains-code-blocks / [ ^ ]





如果有帮助,请标记为答案..



快乐编码......



Check this solution:-


http://leedumond.com/blog/the-controls-collection-cannot-be-modified-because-the-control-contains-code-blocks/[^]


Please Mark as Answer if find helpful..

Happy coding...


这篇关于使用日历扩展程序和用户控件时出错的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆