感谢您使用微软产品。首先,您需要在CS文件中,登记该自定义控件ascx,如下所示:
<%@ Register TagPrefix="myTagPrefix" TagName="myUS" Src="myUserControl.ascx" %>
然后,您在CS文件中问自定义控件myUserControl.ascx中的方法和属性,就如同访问标准的控件一样,如TextBox、Label等。
如访问属性myProperty:
<myTagPrefix:myUS id="myCustomerControl" myProperty="Welcome to China!" runat="server"/>
如访问方法myMethod:
Label1.Text = myCustomerControl.myMethod();关于的ascx自定义控件更详细信息及其示例程序,请参考微软官方网站:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpguide/html/cpconcreatingpageletcontrol.asp
 — 微软全球技术中心 VB支持中心本贴子以“现状”提供且没有任何担保,同时也没有授予任何权利。具体事项可参见使用条款(http://support.microsoft.com/directory/worldwide/zh-cn/community/terms_chs.asp)。
为了为您创建更好的讨论环境,请参加我们的用户满意度调查(http://support.microsoft.com/directory/worldwide/zh-cn/community/survey.asp?key=(S,49854782))。