如何动态使用多个地方的用户控制 [英] How to use User Control more than one place dynamically

查看:89
本文介绍了如何动态使用多个地方的用户控制的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个用户控件,我想使用此控件10处如何实现此功能
任何人都可以帮助我

I have a user Control i want use this control 10 place how to implement this
any one help me

推荐答案

容易.您只需要在CodeBehind中以编程方式添加用户控件(假设您需要根据条件在不同位置添加控件)

请参见 http://msdn.microsoft.com/en-us/library/c0az2h86.aspx [^ ]

另外, http://msdn.microsoft.com/en-us/library/5d0t5fak%28VS.71%29.aspx [ ^ ]


或者,如果您知道需要在何处添加用户控件(并且,如果没有条件),则只需在设计模式下打开aspx页面并将用户控件拖到该页面上即可.就是这样
Easy. You just need to add the user control programmatically in the CodeBehind (Assuming that, you need to add the control in different places based upon condition)

See http://msdn.microsoft.com/en-us/library/c0az2h86.aspx[^]

Also, http://msdn.microsoft.com/en-us/library/5d0t5fak%28VS.71%29.aspx[^]


Or, if you know where you need to add the user control (And, if there is no condition), you just open the aspx page in design mode and drag the user control over it. That''s all




您可以在任何需要的地方使用用户控件,并且可以在网页中放置带有无限时间的控件.首先,您必须在页面指令下方的2个页面中将用户控件注册到您的网页中,并且您可以在任何位置调用用户控件想要进入我们的页面或页面


问候,
Inayat Basha.


u can use ur user control where ever u want and u can place ur controls with infine times in ur web pages.first u have 2 register the user controls in ur web page below the page directive and u can call the user control where ever u want in ur page or pages


Regards,
S.Inayat Basha.


这篇关于如何动态使用多个地方的用户控制的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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