asp.net – 正确使用标签前缀和标签名称?
发布时间:2020-12-16 09:57:50 所属栏目:asp.Net 来源:网络整理
导读:看起来TagPrefix和TagName都是必需的.我想知道每个元素的正确用法是什么?我下面的代码看起来不正确,因为我重复控件的名称两次…… %@ Register TagPrefix="ucCustomerSearch" TagName="ucCustomerSearch" Src="~/UserControls/IndividualSearch.ascx"%%@ Re
看起来TagPrefix和TagName都是必需的.我想知道每个元素的正确用法是什么?我下面的代码看起来不正确,因为我重复控件的名称两次……
<%@ Register TagPrefix="ucCustomerSearch" TagName="ucCustomerSearch" Src="~/UserControls/IndividualSearch.ascx"%> <%@ Register TagPrefix="ucCustomerList" TagName="ucCustomerSearch" Src="~/UserControls/CustomerList.ascx"%> <asp:Content ContentPlaceHolderid="PlaceHolderMain" runat="server"> <ucCustomerSearch:ucCustomerSearch Title="Search" runat="server" /> <ucCustomerList:ucCustomerList Title="Customer List" runat="server" /> </asp:Content> 解决方法
将TagPrefix视为命名空间.你应该对你的控件使用相同的东西,它可能是我或你的项目名称或你真正喜欢的东西.但它不应该与任何控件相同.
(编辑:李大同) 【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容! |
相关内容
- asp.net – Azure应用程序中的4分钟超时
- 如何在ASP.Net 4 Razor和Twitter Bootstrap中使用JQuery Da
- asp.net-core – 运行Add-Migration时无法加载程序集Micros
- asp.net-mvc-3 – 为什么_ViewStart.cshtml访问ViewBag对象
- 谈谈分布式事务(Distributed Transaction)[共5篇]
- 在ASP.NET WebForms中使用jQuery调用’WebMethod’
- asp.net-mvc – 转换常规的MVC网站,用于电话沟通
- asp.net-web-api – 构造函数依赖注入WebApi属性
- asp.net-mvc – 如何设置内联的webgrid行样式
- asp.net – VirtualPathUtility.ToAbsolute()VS. Url.Conte
推荐文章
站长推荐
- asp.net-mvc – 在MVC中,何时使用<%=%>和<%%&g
- asp.net – 使用Linq将单个值返回给SQL
- asp-classic – IE7经典ASP缓存
- ASP.NET – 执行某些代码的全局位置?
- .net – Autofac和IDisposable界面
- asp.net-mvc – 在剑道调度程序中设置星期一到星
- asp.net – 所有PartialView的自定义ActionResul
- asp.net – 定期向用户发送电子邮件以进行密码更
- ASP.NET MVC:如果url与当前url匹配,则将选定的C
- asp.net-mvc-4 – DataAnnotation Range属性的客
热点阅读