语法通用(即< T>)web用户控件

编程入门 行业动态 更新时间:2024-10-27 12:32:24
本文介绍了语法通用(即< T>)web用户控件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

假设我有如下取得了web控件:

Assuming I have made a web control as follows:

public class TestControl<T> : WebControl { ... }

有没有办法把一个.aspx页面上的控制,而无需通过code办呢?我真的希望能够做一些事情,如:

Is there any way to place that control on an .aspx page without having to do it via code? I really want to be able to do something like:

<controls:TestControl<int> runat="server" />

不过,据我所知是没有办法我通过在通用参数。我试着在网上搜索,并发现这个 forums.asp/t/ 1309629.aspx ,这似乎正是我追求的,但似乎没有人掌握什么人想要的,我找不到任何关于计算器相似。

But as far as I can tell there is no way of me passing in the generic parameter. I've tried searching on the web and found this forums.asp/t/1309629.aspx, which appears to be exactly what I'm after, but no one seems to grasp what the guy wanted, and I can't find anything similar on StackOverflow.

推荐答案

没有。有没有办法做到这一点。

No. There's no way to do that.

更多推荐

语法通用(即&LT; T&GT;)web用户控件

本文发布于:2023-11-25 01:01:32,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1627674.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:控件   语法   用户   GT   LT

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!